From 11aef9eddfa7eefc3af33dd1256d72f6785ed27a Mon Sep 17 00:00:00 2001 From: gmc Date: Thu, 18 Nov 2010 16:28:19 +0000 Subject: [PATCH] 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 git-svn-id: svn://svn.open-ils.org/ILS/trunk@18784 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/js/dojo/openils/PermaCrud/Store.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Open-ILS/web/js/dojo/openils/PermaCrud/Store.js b/Open-ILS/web/js/dojo/openils/PermaCrud/Store.js index 19250e0404..205cc383c4 100644 --- a/Open-ILS/web/js/dojo/openils/PermaCrud/Store.js +++ b/Open-ILS/web/js/dojo/openils/PermaCrud/Store.js @@ -613,6 +613,11 @@ if (!dojo._hasResource["openils.PermaCrud.Store"]) { // 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]; -- 2.43.2