fixed bug caused by all volumes having no copies
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 8 Aug 2006 21:29:59 +0000 (21:29 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 8 Aug 2006 21:29:59 +0000 (21:29 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5383 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Cat/Merge.pm

index b5795a1..4e29cec 100644 (file)
@@ -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