Bug 5391 - can't add multiples to batch
authorChris Nighswonger <cnighswonger@foundations.edu>
Fri, 12 Nov 2010 19:56:25 +0000 (14:56 -0500)
committerChris Cormack <chrisc@catalyst.net.nz>
Sun, 12 Dec 2010 20:13:16 +0000 (09:13 +1300)
This was due to the use of an OR which seems to have caused the
param method to be called in a scalar context thus returning only
the first of multiple repeated cgi params.

This patch retains the intent of the OR by replacing it with a
conditional.

Signed-off-by: Koustubha Kale <kmkale@anantcorp.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

labels/label-edit-batch.pl

index 370807c..8f89597 100755 (executable)
@@ -58,7 +58,7 @@ my $display_columns = [ {_label_number  => {label => 'Label Number', link_field
 my $op = $cgi->param('op') || 'edit';
 my $batch_id = $cgi->param('element_id') || $cgi->param('batch_id') || undef;
 my @label_ids = $cgi->param('label_id') if $cgi->param('label_id');
-my @item_numbers = $cgi->param('item_number') || ();
+my @item_numbers = $cgi->param('item_number') if $cgi->param('item_number');
 my $barcode = $cgi->param('barcode') if $cgi->param('barcode');
 
 my $branch_code = get_branch_code_from_name($template->param('LoginBranchname'));