From 51e3e31627c38f88671f8ab399b470ec4a02aaec Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 18 Apr 2016 16:19:47 +0000 Subject: [PATCH] Bug 16256 - Can't edit library EAN if you leave EAN empty Test Plan: 1) Create an empty EAN 2) Edit it and save 3) Note you get a new EAN row 4) Apply this patch 5) Edit the empty EAN again 6) Note you now get an updated EAN and not a new row Signed-off-by: Chris Cormack Depends on bug 16208 (which depends on 16206) Signed-off-by: Katrin Fischer Signed-off-by: Brendan Gallagher --- admin/edi_ean_accounts.pl | 11 +++-------- .../prog/en/modules/admin/edi_ean_accounts.tt | 4 ++-- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/admin/edi_ean_accounts.pl b/admin/edi_ean_accounts.pl index ceb7ef5553..f65ab9e04a 100755 --- a/admin/edi_ean_accounts.pl +++ b/admin/edi_ean_accounts.pl @@ -58,7 +58,7 @@ elsif ( $op eq 'delete_confirm' ) { } else { if ( $op eq 'save' ) { - my $change = $input->param('oldean'); + my $change = $input->param('id'); if ($change) { editsubmit(); } @@ -124,19 +124,14 @@ sub addsubmit { } sub editsubmit { - $schema->resultset('EdifactEan')->search( - { - branchcode => $input->param('oldbranchcode'), - ean => $input->param('oldean'), - } - )->update_all( + $schema->resultset('EdifactEan')->find( $input->param('id') )->update( { branchcode => $input->param('branchcode'), description => $input->param('description'), ean => $input->param('ean'), id_code_qualifier => $input->param('id_code_qualifier'), } - ); + ); return; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_ean_accounts.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_ean_accounts.tt index 1bbf671ff7..03614ad476 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_ean_accounts.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_ean_accounts.tt @@ -52,7 +52,7 @@ [% IF ean %] - + [% END %]
@@ -149,7 +149,7 @@ [% END %] - Edit + Edit Delete -- 2.39.5