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);
# 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( {
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)
+ );
}
}
$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