Browse Source

Bug 5202: QA follow-up 2 - fix overeager error message

When rebasing the patch for this, I accidentally moved the line
setting the mergereference when merging from breeding to *before*
I checked whether we were merging from breeding. Needless to say,
this caused problems. This patch fixes that, and:
* Makes the error translatable.
* Adds a missing authtypesloop argument for the template.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
new/bootstrap-opac
Jared Camins-Esakov 11 years ago
committed by Galen Charlton
parent
commit
cbd9591010
  1. 23
      authorities/merge.pl
  2. 2
      koha-tmpl/intranet-tmpl/prog/en/modules/authorities/merge.tt

23
authorities/merge.pl

@ -96,7 +96,6 @@ else {
if ($mergereference eq 'breeding') {
$recordObj2 = Koha::Authority->get_from_breeding($authid[1]) || Koha::Authority->new();
$mergereference = $authid[0];
} else {
$recordObj2 = Koha::Authority->get_from_authid($authid[1]) || Koha::Authority->new();
}
@ -106,11 +105,14 @@ else {
my $framework;
if ( $recordObj1->authtype ne $recordObj2->authtype && $mergereference ne 'breeding' ) {
$framework = $input->param('frameworkcode')
or push @errors, "Framework not selected.";
or push @errors, { code => 'FRAMEWORK_NOT_SELECTED' };
}
else {
$framework = $recordObj1->authtype;
}
if ($mergereference eq 'breeding') {
$mergereference = $authid[0];
}
# Getting MARC Structure
my $tagslib = GetTagsLabels( 1, $framework );
@ -173,6 +175,23 @@ else {
}
}
my $authtypes = getauthtypes;
my @authtypesloop;
foreach my $thisauthtype (
sort {
$authtypes->{$a}{'authtypetext'} cmp $authtypes->{$b}{'authtypetext'}
}
keys %$authtypes
)
{
my %row = (
value => $thisauthtype,
authtypetext => $authtypes->{$thisauthtype}{'authtypetext'},
);
push @authtypesloop, \%row;
}
$template->{VARS}->{authtypesloop} = \@authtypesloop;
if (@errors) {
# Errors

2
koha-tmpl/intranet-tmpl/prog/en/modules/authorities/merge.tt

@ -54,6 +54,8 @@ function changeFramework(fw) {
[% IF error.code == 'CANNOT_MOVE' %]
The following items could not be moved from the old record to the new one: [% error.value %]
[% ELSIF error.code == 'FRAMEWORK_NOT_SELECTED' %]
No framework has been selected. Please select a framework for merging.
[% ELSE %]
[% error %]
[% END %]

Loading…
Cancel
Save