vandelay copy overlay; prevent update of unrelated copies
authorBill Erickson <berick@esilibrary.com>
Fri, 27 Jul 2012 22:09:22 +0000 (18:09 -0400)
committerBill Erickson <berick@esilibrary.com>
Fri, 27 Jul 2012 22:09:22 +0000 (18:09 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Vandelay.pm

index 139e147..3f75236 100644 (file)
@@ -1614,6 +1614,18 @@ sub import_record_asset_list_impl {
                     next;
                 }
 
+                # prevent update of unrelated copies
+                if ($copy->call_number->record != $rec->imported_as) {
+                    $evt = OpenILS::Event->new('INVALID_IMPORT_COPY_ID', 
+                        note => 'Cannot overlay copies for unlinked bib',
+                        bre => $rec->imported_as, 
+                        copy_id => $copy_id
+                    );
+                    $$report_args{evt} = $evt;
+                    respond_with_status($report_args);
+                    next;
+                }
+
                 # overlaying copies requires an extra permission
                 if (!$e->allowed("IMPORT_OVERLAY_COPY", $copy->call_number->owning_lib)) {
                     $$report_args{evt} = $e->die_event;