From b2ae720fec540a38e48328159068d1d631d002af Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 26 Oct 2015 08:55:43 +0000 Subject: [PATCH] Bug 14889: Fix error msg on duplicate Signed-off-by: Katrin Fischer Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com --- admin/biblio_framework.pl | 7 ++++--- .../prog/en/modules/admin/biblio_framework.tt | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/admin/biblio_framework.pl b/admin/biblio_framework.pl index 79f3eba9d8..79a0db157d 100755 --- a/admin/biblio_framework.pl +++ b/admin/biblio_framework.pl @@ -54,9 +54,10 @@ if ( $op eq 'add_form' ) { } elsif ( $op eq 'add_validate' ) { my $frameworkcode = $input->param('frameworkcode'); my $frameworktext = $input->param('frameworktext'); + my $is_a_modif = $input->param('is_a_modif'); - my $framework = Koha::BiblioFrameworks->find($frameworkcode); - if ($framework) { + if ($is_a_modif) { + my $framework = Koha::BiblioFrameworks->find($frameworkcode); $framework->frameworktext($frameworktext); eval { $framework->store; }; if ($@) { @@ -65,7 +66,7 @@ if ( $op eq 'add_form' ) { push @messages, { type => 'message', code => 'success_on_update' }; } } else { - $framework = Koha::BiblioFramework->new( + my $framework = Koha::BiblioFramework->new( { frameworkcode => $frameworkcode, frameworktext => $frameworktext, } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt index bed0052a38..52ce915a72 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt @@ -151,6 +151,7 @@
  • Framework code: [% framework.frameworkcode %] +
  • [% ELSE %]
  • -- 2.39.5