From 646d132b635909ea0eb0ff816de64115fce87458 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 21 Aug 2014 12:33:53 -0700 Subject: [PATCH] LP#1359934: prevent error opening patron search form As a result of the patch for OpenSRF bug 1316245, JSON2js in the OpenSRF library is now stricter -- in particular, passing an undefined value to it results in an exception being thrown. This patch runs with the increased strictness and fixes an issue where the patron search form was passing an undefined value to JSON2js. Signed-off-by: Galen Charlton Signed-off-by: Ben Shum --- Open-ILS/xul/staff_client/server/patron/search_form.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Open-ILS/xul/staff_client/server/patron/search_form.js b/Open-ILS/xul/staff_client/server/patron/search_form.js index 5fadf55334..e62efa0913 100644 --- a/Open-ILS/xul/staff_client/server/patron/search_form.js +++ b/Open-ILS/xul/staff_client/server/patron/search_form.js @@ -19,7 +19,9 @@ patron.search_form.prototype = { // But we're going to let search_limit and search_sort be configurable now by those spawning this interface, and let's assume there are no corresponding widgets for now. // I'm going to place them into the "obj" scope for this instance. obj.search_limit = params.query.search_limit; - obj.search_sort = JSON2js( params.query.search_sort ); // Let's assume this is encoded as JSON + obj.search_sort = (typeof params.query.search_sort === 'undefined') ? + null : + JSON2js( params.query.search_sort ); // Let's assume this is encoded as JSON JSAN.use('OpenILS.data'); this.OpenILS = {}; obj.OpenILS.data = new OpenILS.data(); obj.OpenILS.data.init({'via':'stash'}); -- 2.43.2