Do not overwrite controlmap entries, but extend them (Floating Subdivisions!)
authorMike Rylander <mrylander@gmail.com>
Tue, 20 Sep 2011 14:55:55 +0000 (10:55 -0400)
committerMike Rylander <mrylander@gmail.com>
Tue, 20 Sep 2011 14:55:55 +0000 (10:55 -0400)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/web/js/dojo/openils/AuthorityControlSet.js

index 36ac521..c6c6c00 100644 (file)
@@ -140,9 +140,15 @@ if(!dojo._hasResource["openils.AuthorityControlSet"]) {
 
                     // build the authority_tag_map
                     dojo.forEach( openils.AuthorityControlSet._controlsets[''+cs.id()].bib_fields, function (bf) {
-                        openils.AuthorityControlSet._controlsets[''+cs.id()].control_map[bf.tag()] = {};
+
+                        if (!openils.AuthorityControlSet._controlsets[''+cs.id()].control_map[bf.tag()])
+                            openils.AuthorityControlSet._controlsets[''+cs.id()].control_map[bf.tag()] = {};
+
                         dojo.forEach( bf.authority_field().sf_list().split(''), function (sf_code) {
-                            openils.AuthorityControlSet._controlsets[''+cs.id()].control_map[bf.tag()][sf_code] = {};
+
+                            if (!openils.AuthorityControlSet._controlsets[''+cs.id()].control_map[bf.tag()][sf_code])
+                                openils.AuthorityControlSet._controlsets[''+cs.id()].control_map[bf.tag()][sf_code] = {};
+
                             openils.AuthorityControlSet._controlsets[''+cs.id()].control_map[bf.tag()][sf_code][bf.authority_field().tag()] = sf_code;
                         });
                     });