webstaff: don't break embedded volcopy editor if volume is empty
authorGalen Charlton <gmc@esilibrary.com>
Mon, 5 Oct 2015 22:13:54 +0000 (18:13 -0400)
committerMike Rylander <mrylander@gmail.com>
Mon, 5 Oct 2015 22:13:54 +0000 (18:13 -0400)
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/web/js/ui/default/staff/cat/services/holdings.js

index 0bebe6c..9112eec 100644 (file)
@@ -296,7 +296,13 @@ function(egCore , $q) {
                     var cp_id_list = [];
                     angular.forEach(
                         $scope.holdingsGridControls.allItems(),
-                        function (item) { cp_id_list = cp_id_list.concat(item.id_list) }
+                        function (item) {
+                            if (item.copy_count > 0) {
+                                // TODO: may want to make some provision for editing
+                                // empty volumes
+                                cp_id_list = cp_id_list.concat(item.id_list)
+                            }
+                        }
                     );
                     return cp_id_list;
                 }