From 3169b7b76cfc61404642ebce447fae2ac76ea27a Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 2 Jul 2020 16:56:46 -0400 Subject: [PATCH] LP1888723 Cat vol update API repairs Repair cases where subs in the volume update API failed to return the expected response constructs, specifically (response, event). Signed-off-by: Bill Erickson Signed-off-by: Ruth Frasur Signed-off-by: Galen Charlton --- .../perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm index db35407a1c..0da6db609b 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm @@ -592,7 +592,7 @@ sub create_volume { my($class, $override, $editor, $vol) = @_; my $evt; - return $evt if ( $evt = $class->org_cannot_have_vols($editor, $vol->owning_lib) ); + return (undef, $evt) if ( $evt = $class->org_cannot_have_vols($editor, $vol->owning_lib) ); $override = { all => 1 } if($override && !ref $override); $override = { all => 0 } if(!ref $override); @@ -600,8 +600,11 @@ sub create_volume { # see if the record this volume references is marked as deleted my $rec = $editor->retrieve_biblio_record_entry($vol->record) or return $editor->die_event; - return OpenILS::Event->new('BIB_RECORD_DELETED', rec => $rec->id) - if $U->is_true($rec->deleted); + + return ( + undef, + OpenILS::Event->new('BIB_RECORD_DELETED', rec => $rec->id) + ) if $U->is_true($rec->deleted); # first lets see if there are any collisions my $vols = $editor->search_asset_call_number( { @@ -620,8 +623,10 @@ sub create_volume { if($override->{all} || grep { $_ eq 'VOLUME_LABEL_EXISTS' } @{$override->{events}}) { $label = $vol->label; } else { - return OpenILS::Event->new( - 'VOLUME_LABEL_EXISTS', payload => $vol->id); + return ( + undef, + OpenILS::Event->new('VOLUME_LABEL_EXISTS', payload => $vol->id) + ); } } @@ -635,7 +640,7 @@ sub create_volume { $vol->edit_date('now'); $vol->clear_id; - $editor->create_asset_call_number($vol) or return $editor->die_event; + $editor->create_asset_call_number($vol) or return (undef, $editor->die_event); if($label) { # now restore the label and merge into the existing record -- 2.11.0