[open-ils-commits] r18784 - trunk/Open-ILS/web/js/dojo/openils/PermaCrud (gmc)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Nov 18 11:28:21 EST 2010
Author: gmc
Date: 2010-11-18 11:28:19 -0500 (Thu, 18 Nov 2010)
New Revision: 18784
Modified:
trunk/Open-ILS/web/js/dojo/openils/PermaCrud/Store.js
Log:
fetchItemByIdentity now returns null immediately upon null identity
Besides being trivially more efficient, this avoids a situation
where pcrud can sometimes time out when attempting to retrieve
a row by a null PK value.
Signed-off-by: Galen Charlton <gmc at esilibrary.com>
Modified: trunk/Open-ILS/web/js/dojo/openils/PermaCrud/Store.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/PermaCrud/Store.js 2010-11-18 15:57:56 UTC (rev 18783)
+++ trunk/Open-ILS/web/js/dojo/openils/PermaCrud/Store.js 2010-11-18 16:28:19 UTC (rev 18784)
@@ -613,6 +613,11 @@
// the *onItem* callback from the *keywordArgs* object. If we
// tried to retrieve the item with pcrud but didn't get an item
// back, issue the *onError* callback.
+ if (keywordArgs.identity == undefined)
+ return null; // Identity API spec unclear whether error callback
+ // would need to be run, so we won't. Matters
+ // because in some cases pcrud times out when attempting
+ // to retrieve by a null PK value
var callback_scope = keywordArgs.scope || dojo.global;
var test_item = this._stored_items[keywordArgs.identity];
More information about the open-ils-commits
mailing list