From 2a6401269e9ab30518cd4ced8097f71b7c6793c8 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 12 Sep 2012 15:18:50 -0400 Subject: [PATCH] Repair invoice LI search order by Ensure that when a user chooses the sort-by-title option in the invoice lineitem search UI, then de-selects the option, the sort returns to the default lineitem ID sort. Signed-off-by: Bill Erickson --- Open-ILS/web/js/ui/default/acq/invoice/view.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Open-ILS/web/js/ui/default/acq/invoice/view.js b/Open-ILS/web/js/ui/default/acq/invoice/view.js index 6c306dba5c..7ac42c99bd 100644 --- a/Open-ILS/web/js/ui/default/acq/invoice/view.js +++ b/Open-ILS/web/js/ui/default/acq/invoice/view.js @@ -296,7 +296,14 @@ function performSearch(pageDir) { if (dojo.byId('acq-invoice-search-sort-title').checked) { uriManager.order_by = [ {"class": "acqlia", "field":"attr_value", "transform":"first"} ]; - } + + } else { + + // last used order_by is cached in the global resultManager config + // in this case, we want to fall back to the default order_by (li.id) + delete resultManager.result_types.lineitem.search_options.order_by; + delete uriManager.order_by; + } resultsLoader.lastSearch = searchObject; resultManager.go(searchObject) -- 2.11.0