LP#849008: Delete button in Admin > Server Settings > Z39.50 Servers doesn't work user/mcooper/lp849008
authorMark Cooper <markchristophercooper@gmail.com>
Fri, 12 Oct 2012 22:18:22 +0000 (15:18 -0700)
committerMark Cooper <markchristophercooper@gmail.com>
Fri, 12 Oct 2012 22:18:22 +0000 (15:18 -0700)
Fix to account for a Z server without attributes being deleted.

Signed-off-by: Mark Cooper <markchristophercooper@gmail.com>
Open-ILS/web/js/ui/default/conify/global/config/z3950_source.js

index 8c7c199..5365709 100644 (file)
@@ -84,7 +84,9 @@ function deleteAttributesThenSources() {
                 var source_code = zsrc['name'];
                 // retrieve attributes
                 var sourceAttrs = pcrud.search('cza', {source : source_code});
-                pcrud.eliminate(sourceAttrs);
+                if(sourceAttrs.length > 0) {
+                    pcrud.eliminate(sourceAttrs);
+                }
             }
         );
         //now attributes are gone it's ok to delete