From: erickson Date: Tue, 8 Aug 2006 21:29:59 +0000 (+0000) Subject: fixed bug caused by all volumes having no copies X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=6a698c92b3b1a89ef1705daafa74c79e084e4158;p=evergreen%2Fpines.git fixed bug caused by all volumes having no copies git-svn-id: svn://svn.open-ils.org/ILS/trunk@5383 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Cat/Merge.pm b/Open-ILS/src/perlmods/OpenILS/Application/Cat/Merge.pm index b5795a12f4..4e29cec829 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Cat/Merge.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Cat/Merge.pm @@ -135,7 +135,11 @@ sub merge_volumes { my %copies; my $evt; - return ($$volumes[0]) if !$master and scalar(@$volumes) == 1; + return ($$volumes[0]) if !$master and @$volumes == 1; + + return ($$volumes[0]) if + $master and @$volumes == 1 + and $master->id == $$volumes[0]->id; $logger->debug("merge: fetching copies for volume list of size ".scalar(@$volumes)); @@ -165,6 +169,8 @@ sub merge_volumes { } } + $bigcn = $$volumes[0]->id unless $bigcn; + $logger->info("merge: merge using volume $bigcn as the master"); # now move all of the copies to the new volume