From c97034b0f0103689153b7666cc9972997e35387c 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) --- admin/edi_ean_accounts.pl | 11 +++-------- .../intranet-tmpl/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 ceb7ef5..f65ab9e 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 1bbf671..03614ad 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.1.4