|
Lines 27-33
use C4::Koha;
Link Here
|
| 27 |
use C4::Biblio; |
27 |
use C4::Biblio; |
| 28 |
|
28 |
|
| 29 |
use Koha::Authority::Types; |
29 |
use Koha::Authority::Types; |
| 30 |
use Koha::Exceptions; |
|
|
| 31 |
use Koha::MetadataRecord::Authority; |
30 |
use Koha::MetadataRecord::Authority; |
| 32 |
|
31 |
|
| 33 |
my $input = new CGI; |
32 |
my $input = new CGI; |
|
Lines 108-114
else {
Link Here
|
| 108 |
push @errors, { code => 'DESTRUCTIVE_MERGE' }; |
107 |
push @errors, { code => 'DESTRUCTIVE_MERGE' }; |
| 109 |
} else { |
108 |
} else { |
| 110 |
my $recordObj1 = Koha::MetadataRecord::Authority->get_from_authid($authid[0]); |
109 |
my $recordObj1 = Koha::MetadataRecord::Authority->get_from_authid($authid[0]); |
| 111 |
Koha::Exceptions::ObjectNotFound->throw( "No authority record found for authid $authid[0]\n" ) if !$recordObj1; |
110 |
if (!$recordObj1) { |
|
|
111 |
push @errors, { code => "MISSING_RECORD", value => $authid[0] }; |
| 112 |
} |
| 113 |
|
| 112 |
|
114 |
|
| 113 |
my $recordObj2; |
115 |
my $recordObj2; |
| 114 |
if (defined $mergereference && $mergereference eq 'breeding') { |
116 |
if (defined $mergereference && $mergereference eq 'breeding') { |
|
Lines 116-124
else {
Link Here
|
| 116 |
} else { |
118 |
} else { |
| 117 |
$recordObj2 = Koha::MetadataRecord::Authority->get_from_authid($authid[1]); |
119 |
$recordObj2 = Koha::MetadataRecord::Authority->get_from_authid($authid[1]); |
| 118 |
} |
120 |
} |
| 119 |
Koha::Exceptions::ObjectNotFound->throw( "No authority record found for authid $authid[1]\n" ) if !$recordObj2; |
121 |
if (!$recordObj2) { |
|
|
122 |
push @errors, { code => "MISSING_RECORD", value => $authid[1] }; |
| 123 |
} |
| 124 |
|
| 125 |
unless ( $recordObj1 && $recordObj2 ) { |
| 126 |
if (@errors) { |
| 127 |
$template->param( errors => \@errors ); |
| 128 |
} |
| 129 |
output_html_with_http_headers $input, $cookie, $template->output; |
| 130 |
exit; |
| 131 |
} |
| 120 |
|
132 |
|
| 121 |
if ($mergereference) { |
133 |
if ($mergereference ) { |
| 122 |
|
134 |
|
| 123 |
my $framework; |
135 |
my $framework; |
| 124 |
if ( $recordObj1->authtypecode ne $recordObj2->authtypecode && $mergereference ne 'breeding' ) { |
136 |
if ( $recordObj1->authtypecode ne $recordObj2->authtypecode && $mergereference ne 'breeding' ) { |