When updating the callnumber on a copy, make sure we fetch the original
callnumber to test for emptiness and cleanup, instead of trying to clean
up the newly assigned callnumber (which will never be "empty").
Signed-off-by: Bill Erickson <berick@esilibrary.com>
$logger->info("vol-update: updating copy ".$copy->id);
my $orig_copy = $editor->retrieve_asset_copy($copy->id);
- my $orig_vol = $editor->retrieve_asset_call_number($copy->call_number);
+
+ # Call-number may have changed, find the original
+ my $orig_vol_id = $editor->json_query({select => {acp => ['call_number']}, from => 'acp', where => {id => $copy->id}});
+ my $orig_vol = $editor->retrieve_asset_call_number($orig_vol_id->[0]->{call_number});
$copy->editor($editor->requestor->id);
$copy->edit_date('now');