[open-ils-commits] r19089 - branches/rel_1_6_2/Open-ILS/xul/staff_client/server/cat (dbs)

svn at svn.open-ils.org svn at svn.open-ils.org
Sat Jan 1 16:20:24 EST 2011


Author: dbs
Date: 2011-01-01 16:20:18 -0500 (Sat, 01 Jan 2011)
New Revision: 19089

Modified:
   branches/rel_1_6_2/Open-ILS/xul/staff_client/server/cat/marcedit.js
Log:
Fix exception thrown in MARC editor searching for bib sources

As reported in https://bugs.launchpad.net/evergreen/+bug/695526,
the attempt to retrieve all of the config.bib_source values using
openils.PermaCrud was failing because the retrieveAll() method
relies on fieldmapper.IDL's setting of the
fieldmapper[hint].Identifier property for each class - but in the
1.6 releases, we're still using fmclasses in XUL instead of
fieldmapper.AutoIDL.

So, to fix the direct problem, we can simply set the property
ourselves on the desired class before invoking retrieveAll();
this avoids touching code paths that might have wider unintended
consequences.


Modified: branches/rel_1_6_2/Open-ILS/xul/staff_client/server/cat/marcedit.js
===================================================================
--- branches/rel_1_6_2/Open-ILS/xul/staff_client/server/cat/marcedit.js	2011-01-01 21:19:44 UTC (rev 19088)
+++ branches/rel_1_6_2/Open-ILS/xul/staff_client/server/cat/marcedit.js	2011-01-01 21:20:18 UTC (rev 19089)
@@ -1,4 +1,4 @@
-// vim: noet:sw=4:ts=4:
+// vim: et:sw=4:ts=4:
 var xmlDeclaration = /^<\?xml version[^>]+?>/;
 
 var serializer = new XMLSerializer();
@@ -2230,9 +2230,9 @@
      * exist - this is specifically in the case of Z39.50 imports. Right now
      * we just avoid populating and showing the config.bib_source list
      */
-	if (!recId) {
-		return false;
-	}
+    if (!recId) {
+        return false;
+    }
 
     var bib = xulG.record.bre;
 
@@ -2241,6 +2241,11 @@
     // cbsList = the XUL menulist that contains the available bib sources 
     var cbsList = dojo.byId('bib-source-list');
 
+    // The openils.PermaCrud.retrieveAll call needs to have this property set
+    // to function properly; normally set via fieldmapper.IDL but in 1.6.2.x
+    // we're still relying on fmclasses
+    fieldmapper['cbs'].Identifier = 'id';
+
     // bibSources = an array containing all of the bib source objects
     var bibSources = new openils.PermaCrud({"authtoken": authtoken}).retrieveAll('cbs');
 



More information about the open-ils-commits mailing list