JBAS-673 Post 2.9 multi-page repairs
authorBill Erickson <berickxx@gmail.com>
Mon, 12 Jun 2017 21:33:52 +0000 (17:33 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
Only attempt to render copy details for lineitems that are part of the
currently displayed page of lineitems.  Alt fix for LP#1208613.

To ease debugging and eventual support by the browser client, use the
borwser's localStorage object when not in XUL mode.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/web/js/ui/default/acq/common/li_table.js

index a50eb98..e90c724 100644 (file)
@@ -22,7 +22,13 @@ dojo.require('openils.CGI');
 // KCLS: used for tracking selected lineitems that are
 // not visibible in the current page of lineitems.
 // Stores a JSON hash of lineitem ID's
-var checkBoxStorage = openils.XUL.localStorage();
+var checkBoxStorage;
+if (openils.XUL.localStorage) {
+    checkBoxStorage = openils.XUL.localStorage();
+} else {
+    // use browser localStorage outside of the XUL interface.
+    checkBoxStorage = localStorage;
+}
 
 if (window.location.toString().indexOf('picklist/view/') < 0) {
     // only tracking selection of multiple pages of
@@ -1900,6 +1906,12 @@ function AcqLiTable() {
         var containerRow = dojo.byId('acq-inline-copies-row-' + liId);
         var liRow = dojo.query('[li=' + liId + ']')[0];
 
+        // KCLS JBAS-673 / Alternate fix for LP#1208613
+        // liCache contains lineitems from multiple pages.  If liRow
+        // is null, it's from a different page.  Avoid any attempts to
+        // draw its copy details (since they won't be visible).
+        if (!liRow) return;
+
         if (!containerRow) {
 
             // build the inline copies container row and add it to