From 7f045ef8e9e525b531ed732e4799b0fedbedbe59 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 18 Apr 2016 16:10:34 +0000 Subject: [PATCH] [PASSED QA] Bug 16208 - Can't delete a library EAN if the EAN value is empty Test Plan: 1) Create an empty EAN 2) Attempt to delete it, you should get an error 3) Apply this patch 4) Attempt to delete the EAN, you should now be able to Signed-off-by: Chris Cormack This depends on bug 16206 being pushed, or you need to apply that patch first Signed-off-by: Katrin Fischer https://bugs.koha-community.org/show_bug.cgi?id=16256 Signed-off-by: Katrin Fischer --- admin/edi_ean_accounts.pl | 25 ++++++---------------- .../prog/en/modules/admin/edi_ean_accounts.tt | 5 ++--- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/admin/edi_ean_accounts.pl b/admin/edi_ean_accounts.pl index 4b32c69..ceb7ef5 100755 --- a/admin/edi_ean_accounts.pl +++ b/admin/edi_ean_accounts.pl @@ -103,13 +103,9 @@ $template->param( output_html_with_http_headers( $input, $cookie, $template->output ); sub delsubmit { - my $ean = $schema->resultset('EdifactEan')->find( - { - branchcode => $input->param('branchcode'), - ean => $input->param('ean') - } - ); - $ean->delete; + my $id = $input->param('id'); + my $e = $schema->resultset('EdifactEan')->find( $id ); + $e->delete if $e; return; } @@ -128,7 +124,6 @@ sub addsubmit { } sub editsubmit { - warn "DESC: " . $input->param('description'); $schema->resultset('EdifactEan')->search( { branchcode => $input->param('oldbranchcode'), @@ -146,16 +141,8 @@ sub editsubmit { } sub show_ean { - my $branchcode = $input->param('branchcode'); - my $ean = $input->param('ean'); - if ( $branchcode && $ean ) { - my $e = $schema->resultset('EdifactEan')->find( - { - ean => $ean, - branchcode => $branchcode, - } - ); - $template->param( ean => $e ); - } + my $id = $input->param('id'); + my $e = $schema->resultset('EdifactEan')->find( $id ); + $template->param( ean => $e ); 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 1a07a02..d5d5bc0 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 @@ -116,8 +116,7 @@

Delete EAN [% ean.ean %] for [% ean.branch.branchname %]?

- - +
@@ -151,7 +150,7 @@ Edit - Delete + Delete [% END %] -- 1.9.1