View | Details | Raw Unified | Return to bug 17380
Collapse All | Expand All

(-)a/authorities/merge.pl (-4 / +16 lines)
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' ) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/merge.tt (-1 / +2 lines)
Lines 67-72 function changeFramework(fw) { Link Here
67
                The Default framework cannot be used, or the framework does not exist. Please select another framework for merging.
67
                The Default framework cannot be used, or the framework does not exist. Please select another framework for merging.
68
            [% ELSIF error.code == 'EMPTY_MARC' %]
68
            [% ELSIF error.code == 'EMPTY_MARC' %]
69
                Sorry, but we did not find any MARC tags in the reference record.
69
                Sorry, but we did not find any MARC tags in the reference record.
70
            [% ELSIF error.code == 'MISSING_RECORD' %]
71
                Sorry, but we did not find a record for number: [% error.value %].
70
            [% ELSE %]
72
            [% ELSE %]
71
                [% error %]
73
                [% error %]
72
            [% END %]
74
            [% END %]
73
- 

Return to bug 17380