From a159d2b067c62bbfd524709813071951bc600ae4 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 29 Mar 2016 09:52:25 +0100 Subject: [PATCH] Bug 16154: CGI->multi_param - Assign a list This patch replaces the occurrences of @foo = $cgi->param('foo'); with @foo = $cgi->multi_param('foo'); perl -p -i -e 's/^(\s*@\w+\s*=\s*)\$(cgi|input|query)\->param\(/$1\$$2\->multi_param\(/xms' **/*.pl Signed-off-by: Owen Leonard Signed-off-by: Katrin Fischer Signed-off-by: Brendan Gallagher --- acqui/finishreceive.pl | 2 +- catalogue/search.pl | 2 +- labels/label-create-csv.pl | 4 ++-- labels/label-create-pdf.pl | 4 ++-- labels/label-create-xml.pl | 4 ++-- labels/label-edit-batch.pl | 4 ++-- labels/label-print.pl | 6 +++--- opac/opac-search.pl | 2 +- patroncards/edit-batch.pl | 6 +++--- reserve/renewscript.pl | 8 ++++---- tags/review.pl | 2 +- tools/export.pl | 2 +- 12 files changed, 23 insertions(+), 23 deletions(-) diff --git a/acqui/finishreceive.pl b/acqui/finishreceive.pl index 06be5b0a48..111eadcc5c 100755 --- a/acqui/finishreceive.pl +++ b/acqui/finishreceive.pl @@ -65,7 +65,7 @@ my $new_ordernumber = $ordernumber; if ($quantityrec > $origquantityrec ) { my @received_items = (); if(C4::Context->preference('AcqCreateItem') eq 'ordering') { - @received_items = $input->param('items_to_receive'); + @received_items = $input->multi_param('items_to_receive'); my @affects = split q{\|}, C4::Context->preference("AcqItemSetSubfieldsWhenReceived"); if ( @affects ) { my $frameworkcode = GetFrameworkCode($biblionumber); diff --git a/catalogue/search.pl b/catalogue/search.pl index 8dd8c4a2cb..dd73277bdf 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -365,7 +365,7 @@ if ( C4::Context->preference('defaultSortField') . C4::Context->preference('defaultSortOrder'); } -@sort_by = $cgi->param('sort_by'); +@sort_by = $cgi->multi_param('sort_by'); $sort_by[0] = $default_sort_by unless $sort_by[0]; foreach my $sort (@sort_by) { $template->param($sort => 1) if $sort; diff --git a/labels/label-create-csv.pl b/labels/label-create-csv.pl index 9c1f1d6912..41dc77858b 100755 --- a/labels/label-create-csv.pl +++ b/labels/label-create-csv.pl @@ -37,8 +37,8 @@ my @item_numbers; $batch_id = $cgi->param('batch_id') if $cgi->param('batch_id'); my $template_id = $cgi->param('template_id') || undef; my $layout_id = $cgi->param('layout_id') || undef; -@label_ids = $cgi->param('label_id') if $cgi->param('label_id'); -@item_numbers = $cgi->param('item_number') if $cgi->param('item_number'); +@label_ids = $cgi->multi_param('label_id') if $cgi->param('label_id'); +@item_numbers = $cgi->multi_param('item_number') if $cgi->param('item_number'); my $items = undef; diff --git a/labels/label-create-pdf.pl b/labels/label-create-pdf.pl index 5589fb6c54..c15c7e7405 100755 --- a/labels/label-create-pdf.pl +++ b/labels/label-create-pdf.pl @@ -45,8 +45,8 @@ $batch_id = $cgi->param('batch_id') if $cgi->param('batch_id'); my $template_id = $cgi->param('template_id') || undef; my $layout_id = $cgi->param('layout_id') || undef; my $start_label = $cgi->param('start_label') || 1; -@label_ids = $cgi->param('label_id') if $cgi->param('label_id'); -@item_numbers = $cgi->param('item_number') if $cgi->param('item_number'); +@label_ids = $cgi->multi_param('label_id') if $cgi->param('label_id'); +@item_numbers = $cgi->multi_param('item_number') if $cgi->param('item_number'); my $items = undef; diff --git a/labels/label-create-xml.pl b/labels/label-create-xml.pl index a3a0d63ba5..bed86e27d0 100755 --- a/labels/label-create-xml.pl +++ b/labels/label-create-xml.pl @@ -37,8 +37,8 @@ my @item_numbers; $batch_id = $cgi->param('batch_id') if $cgi->param('batch_id'); my $template_id = $cgi->param('template_id') || undef; my $layout_id = $cgi->param('layout_id') || undef; -@label_ids = $cgi->param('label_id') if $cgi->param('label_id'); -@item_numbers = $cgi->param('item_number') if $cgi->param('item_number'); +@label_ids = $cgi->multi_param('label_id') if $cgi->param('label_id'); +@item_numbers = $cgi->multi_param('item_number') if $cgi->param('item_number'); my $items = undef; diff --git a/labels/label-edit-batch.pl b/labels/label-edit-batch.pl index 6a1b426e7c..004087c0f5 100755 --- a/labels/label-edit-batch.pl +++ b/labels/label-edit-batch.pl @@ -61,8 +61,8 @@ my @item_numbers; my $number_list; my $number_type = $cgi->param('number_type') || "barcode"; my $batch_id = $cgi->param('element_id') || $cgi->param('batch_id') || 0; -@label_ids = $cgi->param('label_id') if $cgi->param('label_id'); -@item_numbers = $cgi->param('item_number') if $cgi->param('item_number'); +@label_ids = $cgi->multi_param('label_id') if $cgi->param('label_id'); +@item_numbers = $cgi->multi_param('item_number') if $cgi->param('item_number'); $number_list = $cgi->param('number_list') if $cgi->param('number_list'); my $branch_code = C4::Context->userenv->{'branch'}; diff --git a/labels/label-print.pl b/labels/label-print.pl index 55923239a7..a8ba29c269 100755 --- a/labels/label-print.pl +++ b/labels/label-print.pl @@ -42,14 +42,14 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( my $op = $cgi->param('op') || 'none'; my @label_ids; -@label_ids = $cgi->param('label_id') if $cgi->param('label_id'); # this will handle individual label printing +@label_ids = $cgi->multi_param('label_id') if $cgi->param('label_id'); # this will handle individual label printing my @batch_ids; -@batch_ids = $cgi->param('batch_id') if $cgi->param('batch_id'); +@batch_ids = $cgi->multi_param('batch_id') if $cgi->param('batch_id'); my $layout_id = $cgi->param('layout_id') || undef; my $template_id = $cgi->param('template_id') || undef; my $start_label = $cgi->param('start_label') || 1; my @item_numbers; -@item_numbers = $cgi->param('item_number') if $cgi->param('item_number'); +@item_numbers = $cgi->multi_param('item_number') if $cgi->param('item_number'); my $output_format = $cgi->param('output_format') || 'pdf'; my $referer = $cgi->param('referer') || undef; diff --git a/opac/opac-search.pl b/opac/opac-search.pl index abd7847037..64b88006f6 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -425,7 +425,7 @@ if ( C4::Context->preference('OPACdefaultSortField') } my @allowed_sortby = qw /acqdate_asc acqdate_dsc author_az author_za call_number_asc call_number_dsc popularity_asc popularity_dsc pubdate_asc pubdate_dsc relevance title_az title_za/; -@sort_by = $cgi->param('sort_by'); +@sort_by = $cgi->multi_param('sort_by'); $sort_by[0] = $default_sort_by if !$sort_by[0] && defined($default_sort_by); foreach my $sort (@sort_by) { if ( grep { /^$sort$/ } @allowed_sortby ) { diff --git a/patroncards/edit-batch.pl b/patroncards/edit-batch.pl index 621281b381..cd1f774b5d 100755 --- a/patroncards/edit-batch.pl +++ b/patroncards/edit-batch.pl @@ -55,9 +55,9 @@ my $display_columns = [ {_summary => {label => 'Summary', link_field => 0} my $op = $cgi->param('op') || 'new'; my $batch_id = $cgi->param('element_id') || $cgi->param('batch_id') || 0; my ( @label_ids, @item_numbers, @borrower_numbers ); -@label_ids = $cgi->param('label_id') if $cgi->param('label_id'); -@item_numbers = $cgi->param('item_number') if $cgi->param('item_number'); -@borrower_numbers = $cgi->param('borrower_number') if $cgi->param('borrower_number'); +@label_ids = $cgi->multi_param('label_id') if $cgi->param('label_id'); +@item_numbers = $cgi->multi_param('item_number') if $cgi->param('item_number'); +@borrower_numbers = $cgi->multi_param('borrower_number') if $cgi->param('borrower_number'); my $errstr = $cgi->param('error') || ''; my $bor_num_list = $cgi->param('bor_num_list') || undef; my $branch_code = C4::Context->userenv->{'branch'}; diff --git a/reserve/renewscript.pl b/reserve/renewscript.pl index ac31e16607..c2cd5bd6d3 100755 --- a/reserve/renewscript.pl +++ b/reserve/renewscript.pl @@ -50,18 +50,18 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( my @data; if ( $input->param('renew_all') ) { - @data = $input->param('all_items[]'); + @data = $input->multi_param('all_items[]'); } else { - @data = $input->param('items[]'); + @data = $input->multi_param('items[]'); } my @barcodes; if ( $input->param('return_all') ) { - @barcodes = $input->param('all_barcodes[]'); + @barcodes = $input->multi_param('all_barcodes[]'); } else { - @barcodes = $input->param('barcodes[]'); + @barcodes = $input->multi_param('barcodes[]'); } my $branch = $input->param('branch'); diff --git a/tags/review.pl b/tags/review.pl index 1f9bddbb9a..b7e959b69b 100755 --- a/tags/review.pl +++ b/tags/review.pl @@ -97,7 +97,7 @@ foreach (qw( approve reject test )) { } $op ||= 'none'; -@tags = $input->param('tags'); +@tags = $input->multi_param('tags'); $borrowernumber == 0 and push @errors, {op_zero=>1}; if ($op eq 'approve') { diff --git a/tools/export.pl b/tools/export.pl index a4c02dac23..f0e2570a5a 100755 --- a/tools/export.pl +++ b/tools/export.pl @@ -48,7 +48,7 @@ my @record_ids; # biblionumbers is sent from circulation.pl only if ( $query->param("biblionumbers") ) { $record_type = 'bibs'; - @record_ids = $query->param("biblionumbers"); + @record_ids = $query->multi_param("biblionumbers"); } # Default value for output_format is 'iso2709' -- 2.39.5