From af54c42b0d620faac78310aafd33cbe8bf42a10d Mon Sep 17 00:00:00 2001 From: Jeff Davis Date: Wed, 31 Aug 2022 15:39:55 -0700 Subject: [PATCH] LP#1975879: avoid propagating owning library changes for dummy call numbers Signed-off-by: Jeff Davis --- .../src/perlmods/lib/OpenILS/Application/Cat.pm | 27 ++++++++++++---------- 1 file changed, 15 insertions(+), 12 deletions(-) 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) { -- 2.11.0