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