LP#1799963 - fix catalog advanced search type default user/cesardv/lp1799963-fix-staff-cat-default-search-pane
authorCesar Velez <cesar.velez@equinoxinitiative.org>
Thu, 25 Oct 2018 21:54:42 +0000 (17:54 -0400)
committerCesar Velez <cesar.velez@equinoxinitiative.org>
Thu, 25 Oct 2018 21:54:42 +0000 (17:54 -0400)
Since eg.search.adv_pane is now a server stored WS setting
it needed to be fetched with the proper way in order to work.

Signed-off by: Cesar Velez <cesar.velez@equinoxinitiative.org>

Open-ILS/web/js/ui/default/staff/cat/catalog/app.js

index 43af4d5..ed0d70a 100644 (file)
@@ -1888,13 +1888,15 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e
         // whatever default pane the user has chosen via workstation
         // preference
         if (url.match(/\/opac\/advanced$/)) {
-            var adv_pane = egCore.hatch.getLocalItem('eg.search.adv_pane');
-            if (adv_pane) {
-                url += '?pane=' + encodeURIComponent(adv_pane);
-            }
+            egCore.hatch.getItem('eg.search.adv_pane').then(function(adv_pane_val){
+                if (adv_pane_val) {
+                    url += '?pane=' + encodeURIComponent(adv_pane_val);
+                }
+
+                $scope.catalog_url = url;
+            });
         }
 
-        $scope.catalog_url = url;
     }
 
     function init_parts_url() {