|
Lines 27-32
use Koha::MetadataRecord::Authority;
Link Here
|
| 27 |
use C4::Koha; |
27 |
use C4::Koha; |
| 28 |
use C4::Biblio; |
28 |
use C4::Biblio; |
| 29 |
|
29 |
|
|
|
30 |
use Koha::Exceptions; |
| 31 |
|
| 30 |
my $input = new CGI; |
32 |
my $input = new CGI; |
| 31 |
my @authid = $input->multi_param('authid'); |
33 |
my @authid = $input->multi_param('authid'); |
| 32 |
my $merge = $input->param('merge'); |
34 |
my $merge = $input->param('merge'); |
|
Lines 87-100
else {
Link Here
|
| 87 |
push @errors, { code => "WRONG_COUNT", value => scalar(@authid) }; |
89 |
push @errors, { code => "WRONG_COUNT", value => scalar(@authid) }; |
| 88 |
} |
90 |
} |
| 89 |
else { |
91 |
else { |
| 90 |
my $recordObj1 = Koha::MetadataRecord::Authority->get_from_authid($authid[0]) || Koha::MetadataRecord::Authority->new(); |
92 |
my $recordObj1 = Koha::MetadataRecord::Authority->get_from_authid($authid[0]); |
| 91 |
my $recordObj2; |
93 |
Koha::Exceptions::ObjectNotFound->throw( "No authority record found for authid $authid[0]\n" ) if !$recordObj1; |
| 92 |
|
94 |
|
|
|
95 |
my $recordObj2; |
| 93 |
if (defined $mergereference && $mergereference eq 'breeding') { |
96 |
if (defined $mergereference && $mergereference eq 'breeding') { |
| 94 |
$recordObj2 = Koha::MetadataRecord::Authority->get_from_breeding($authid[1]) || Koha::MetadataRecord::Authority->new(); |
97 |
$recordObj2 = Koha::MetadataRecord::Authority->get_from_breeding($authid[1]); |
| 95 |
} else { |
98 |
} else { |
| 96 |
$recordObj2 = Koha::MetadataRecord::Authority->get_from_authid($authid[1]) || Koha::MetadataRecord::Authority->new(); |
99 |
$recordObj2 = Koha::MetadataRecord::Authority->get_from_authid($authid[1]); |
| 97 |
} |
100 |
} |
|
|
101 |
Koha::Exceptions::ObjectNotFound->throw( "No authority record found for authid $authid[1]\n" ) if !$recordObj2; |
| 98 |
|
102 |
|
| 99 |
if ($mergereference) { |
103 |
if ($mergereference) { |
| 100 |
|
104 |
|
| 101 |
- |
|
|