webstaff: clean up console noise
authorGalen Charlton <gmc@esilibrary.com>
Mon, 1 Feb 2016 16:43:09 +0000 (11:43 -0500)
committerKathy Lussier <klussier@masslnc.org>
Tue, 2 Feb 2016 19:58:55 +0000 (14:58 -0500)
Ensure that if a default stat cat OU filter is not set,
that errors aren't logged when creating a new volume/copy.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js

index cef2bf3..ce8f29c 100644 (file)
@@ -751,7 +751,10 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
                 $scope.batch.prefix = $scope.defaults.prefix;
                 $scope.batch.suffix = $scope.defaults.suffix;
                 $scope.working.statcat_filter = $scope.defaults.statcat_filter;
-                if (typeof $scope.defaults.statcat_filter == 'object') {
+                if (
+                        typeof $scope.defaults.statcat_filter == 'object' &&
+                        Object.keys($scope.defaults.statcat_filter).length > 0
+                   ) {
                     // want fieldmapper object here...
                     $scope.defaults.statcat_filter =
                          egCore.idl.Clone($scope.defaults.statcat_filter);
@@ -1559,7 +1562,10 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
                         if (t) {
                             $scope.defaults = t;
                             $scope.working.statcat_filter = $scope.defaults.statcat_filter;
-                            if (typeof $scope.defaults.statcat_filter == 'object') {
+                            if (
+                                    typeof $scope.defaults.statcat_filter == 'object' &&
+                                    Object.keys($scope.defaults.statcat_filter).length > 0
+                                ) {
                                 // want fieldmapper object here...
                                 $scope.defaults.statcat_filter =
                                     egCore.idl.Clone($scope.defaults.statcat_filter);