From 51f587e013d084353053e42340900e4b99d3bbac Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Sun, 29 Jul 2012 22:10:18 -0400 Subject: [PATCH] vandelay copy overlay; perl cleanup Signed-off-by: Bill Erickson --- Open-ILS/src/perlmods/lib/OpenILS/Application/Vandelay.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Vandelay.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Vandelay.pm index b5a6b28932..6ca4b6bad1 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Vandelay.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Vandelay.pm @@ -1609,7 +1609,7 @@ sub import_record_asset_list_impl { $copy = $e->search_asset_copy([ {id => $copy_id, deleted => 'f'}, {flesh => 1, flesh_fields => {acp => ['call_number']}} - ]); + ])->[0]; if (!$copy) { $$report_args{evt} = $e->die_event; @@ -1618,8 +1618,8 @@ sub import_record_asset_list_impl { } # prevent update of unrelated copies - if ($copy->call_number->record != $rec_id) { - $logger->info("vl: attempt to overlay unrelated copy=$copy_id; rec=$rec_id"); + if ($copy->call_number->record != $rec->imported_as) { + $logger->info("vl: attempt to overlay unrelated copy=$copy_id; rec=".$rec->imported_as); $evt = OpenILS::Event->new('INVALID_IMPORT_COPY_ID', note => 'Cannot overlay copies for unlinked bib', @@ -1705,6 +1705,7 @@ sub import_record_asset_list_impl { # de-flesh for update $copy->call_number($copy->call_number->id); + $copy->ischanged(1); $evt = OpenILS::Application::Cat::AssetCommon-> update_fleshed_copies($e, {all => 1}, undef, [$copy]); @@ -1805,7 +1806,6 @@ sub import_record_asset_list_impl { respond_with_status($report_args); $logger->info("vl: successfully imported item " . $item->barcode); } - } $roe->rollback; -- 2.11.0