From 8d40fd2c6ebad16d7f9154bf6d6821d3b7e059de Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 27 Sep 2016 09:24:57 +0100 Subject: [PATCH] Bug 17216: Internal AV should be correctly handled when creating a new category Signed-off-by: Katrin Fischer Signed-off-by: Brendan Gallagher --- admin/authorised_values.pl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/admin/authorised_values.pl b/admin/authorised_values.pl index 5aecc3c80d..bb94e23993 100755 --- a/admin/authorised_values.pl +++ b/admin/authorised_values.pl @@ -167,7 +167,11 @@ if ($op eq 'add_form') { ); if ( $already_exists ) { - push @messages, {type => 'error', code => 'cat_already_exists' }; + if ( $new_category eq 'branches' or $new_category eq 'itemtypes' or $new_category eq 'cn_source' ) { + push @messages, {type => 'error', code => 'invalid_category_name' }; + } else { + push @messages, {type => 'error', code => 'cat_already_exists' }; + } } else { # Insert my $av = Koha::AuthorisedValueCategory->new( { @@ -182,11 +186,11 @@ if ($op eq 'add_form') { push @messages, {type => 'error', code => 'error_on_insert_cat' }; } else { push @messages, { type => 'message', code => 'success_on_insert_cat' }; + $searchfield = $new_category; } } $op = 'list'; - $searchfield = $new_category; } elsif ($op eq 'delete') { my $av = Koha::AuthorisedValues->new->find( $input->param('id') ); my $deleted = eval {$av->delete}; -- 2.39.5