From fa9f5ba518335bc8278ea2659e5456bcd9d7f083 Mon Sep 17 00:00:00 2001 From: dbs Date: Sat, 1 Jan 2011 21:19:44 +0000 Subject: [PATCH] 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. git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_6@19088 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/xul/staff_client/server/cat/marcedit.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/cat/marcedit.js b/Open-ILS/xul/staff_client/server/cat/marcedit.js index b6c177a07b..2360d36398 100644 --- a/Open-ILS/xul/staff_client/server/cat/marcedit.js +++ b/Open-ILS/xul/staff_client/server/cat/marcedit.js @@ -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 @@ function buildBibSourceList (authtoken, recId) { * 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 @@ function buildBibSourceList (authtoken, recId) { // 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'); -- 2.11.0