Fix unified interface w/ editing multiple volumes
authorJason Etheridge <jason@esilibrary.com>
Wed, 7 Sep 2011 07:29:40 +0000 (03:29 -0400)
committerMike Rylander <mrylander@gmail.com>
Wed, 7 Sep 2011 20:33:32 +0000 (16:33 -0400)
commit9911ea7643e742a52cbf8446bbbf8de799eb7a1b
tree7e6a3d4de6198bb24b2a6e73c9b716fba324b36c
parent883a5a0c1cddd6d5b523cbc0af95f346c4af1a19
Fix unified interface w/ editing multiple volumes

Breakage if editing existing items across volumes with non-default values for
call number class, prefix, or suffix.  This was due to some logic happening
within a loop that was sadly referencing data that changed out from under it
with every loop iteration (so for example, we were effectively referencing the
last rendered class menu instead of each in turn).

Remember folks:

for (var unsafe = 0; unsafe < 10; unsafe++) {
    setTimeout(
        function(safe) {
            return function() {
                do_something_with(safe); // good
                do_something_with(unsafe); // bad
            };
        }(unsafe),
        1000
    );
}

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js