From 0be8d0ac9d5baec607218371ccb81090daa3a91e Mon Sep 17 00:00:00 2001 From: Chris Nighswonger Date: Sun, 7 Feb 2010 22:06:36 -0500 Subject: [PATCH] Bugfix: Correcting conditional for branch code check Also removing needless conditionals on redirects. Thanks to Braedon Vickers for catching the incorrect conditional. Signed-off-by: Galen Charlton --- patroncards/edit-batch.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/patroncards/edit-batch.pl b/patroncards/edit-batch.pl index 47f0896966..3db898caf4 100755 --- a/patroncards/edit-batch.pl +++ b/patroncards/edit-batch.pl @@ -109,9 +109,9 @@ elsif ($op eq 'edit') { $batch = C4::Patroncards::Batch->retrieve(batch_id => $batch_id); } elsif ($op eq 'new') { - if (!$branch_code) { + if ($branch_code eq '') { warn sprintf('Batch edit interface called with an invalid/non-existent branch code: %s',$branch_code ? $branch_code : 'NULL'); - print $cgi->redirect("manage.pl?card_element=batch&error=203") if $err; + print $cgi->redirect("manage.pl?card_element=batch&error=203"); exit; } $batch = C4::Patroncards::Batch->new(branch_code => $branch_code); @@ -119,7 +119,7 @@ elsif ($op eq 'new') { } else { warn sprintf('Batch edit interface called an unsupported operation: %s',$op); - print $cgi->redirect("manage.pl?card_element=batch&error=202") if $err; + print $cgi->redirect("manage.pl?card_element=batch&error=202"); exit; } -- 2.39.2