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

(-)a/authorities/merge.pl (-3 / +16 lines)
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' ) {
(-)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