From: Jeff Davis Date: Wed, 31 Aug 2022 22:39:55 +0000 (-0700) Subject: LP#1975879: avoid propagating owning library changes for dummy call numbers X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fjeffdavis%2Flp1975879-volcopy-edit-callnum-owner-v2.5;p=working%2FEvergreen.git LP#1975879: avoid propagating owning library changes for dummy call numbers Signed-off-by: Jeff Davis --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm index c48261b080..1a635b12d6 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm @@ -1228,18 +1228,21 @@ sub fleshed_volume_update { my $copy_ids = [map {$_->id} @$copies]; - # Avoid in-empty-list - my @copy_filter = @$copy_ids ? (id => {'not in' => $copy_ids}) : (); - - my $addl_copies = $editor->search_asset_copy( - { call_number => $vol->id, - @copy_filter, - circ_lib => {'<>' => $vol->owning_lib}, - deleted => 'f' - }, {substream => 1} # could be many - ); - - $copies = [@$copies, @$addl_copies]; + # grab copies to propagate to, unless this is a dummy call number + if ($vol->id >= 0) { + # Avoid in-empty-list + my @copy_filter = @$copy_ids ? (id => {'not in' => $copy_ids}) : (); + + my $addl_copies = $editor->search_asset_copy( + { call_number => $vol->id, + @copy_filter, + circ_lib => {'<>' => $vol->owning_lib}, + deleted => 'f' + }, {substream => 1} # could be many + ); + + $copies = [@$copies, @$addl_copies]; + } for (@$copies) { if ($_->circ_lib != $vol->owning_lib) {