From 58e662f046b178ad7696a288c9e26546216902a1 Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Mon, 26 Jun 2017 08:11:28 -0400 Subject: [PATCH] lp1678152 webstaff fix Add Copies & Volumes Changes open-ils.cat.asset.volume.fleshed.batch.update, AssetCommon::create_volume, and Cat::Merge::merge_volumes to handle auto-volume merges during volume creation. Signed-off-by: Jason Etheridge Signed-off-by: Mike Rylander --- Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm | 2 +- .../src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm index 211e7c88c5..0800b889cd 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm @@ -1102,7 +1102,7 @@ sub fleshed_volume_update { } elsif( $vol->isnew ) { $logger->info("vol-update: creating volume"); - $evt = $assetcom->create_volume( $oargs, $editor, $vol ); + ($vol,$evt) = $assetcom->create_volume( $auto_merge_vols ? { all => 1} : $oargs, $editor, $vol ); return $evt if $evt; } elsif( $vol->ischanged ) { 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 69e5b4b860..4b81a46bb9 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm @@ -551,12 +551,10 @@ sub create_volume { if($label) { # now restore the label and merge into the existing record $vol->label($label); - (undef, $evt) = - OpenILS::Application::Cat::Merge::merge_volumes($editor, [$vol], $$vols[0]); - return $evt if $evt; + return OpenILS::Application::Cat::Merge::merge_volumes($editor, [$vol], $$vols[0]); } - return undef; + return ($vol); } # returns the volume if it exists @@ -598,10 +596,7 @@ sub find_or_create_volume { $vol->suffix($suffix); $vol->record($record_id); - my $evt = $class->create_volume(0, $e, $vol); - return (undef, $evt) if $evt; - - return ($vol); + return $class->create_volume(0, $e, $vol); } -- 2.11.0