X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=patroncards%2Fedit-batch.pl;h=47f08969668459af84bb9904af89d716870ce2ce;hb=a97aab0212f2d41221df3b387d57e1dd03f539e9;hp=9c3a57d406e8386f32f202793b3e221b69cd5aae;hpb=5a929b0c16bee0f03cfe9501f691c0c57eca4c82;p=koha.git diff --git a/patroncards/edit-batch.pl b/patroncards/edit-batch.pl index 9c3a57d406..47f0896966 100755 --- a/patroncards/edit-batch.pl +++ b/patroncards/edit-batch.pl @@ -105,10 +105,15 @@ elsif ($op eq 'de_duplicate') { exit; } } -elsif ($op = 'edit') { +elsif ($op eq 'edit') { $batch = C4::Patroncards::Batch->retrieve(batch_id => $batch_id); } elsif ($op eq 'new') { + if (!$branch_code) { + 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; + exit; + } $batch = C4::Patroncards::Batch->new(branch_code => $branch_code); $batch_id = $batch->get_attr('batch_id'); }