Bugzilla – Attachment 50760 Details for
Bug 16154
Replace CGI->param with CGI->multi_param in list context
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 16154: CGI->multi_param - Assign a list
PASSED-QA-Bug-16154-CGI-multiparam---Assign-a-list.patch (text/plain), 9.29 KB, created by
Katrin Fischer
on 2016-04-26 21:02:03 UTC
(
hide
)
Description:
[PASSED QA] Bug 16154: CGI->multi_param - Assign a list
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2016-04-26 21:02:03 UTC
Size:
9.29 KB
patch
obsolete
>From cb800ed776f7a7c08d25daaad1bc16f2ee9526f0 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 29 Mar 2016 09:52:25 +0100 >Subject: [PATCH] [PASSED QA] 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 <oleonard@myacpl.org> >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > 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 06be5b0..111eadc 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 1c9a4fd..6aad42c 100755 >--- a/catalogue/search.pl >+++ b/catalogue/search.pl >@@ -384,7 +384,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 9c1f1d6..41dc778 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 5589fb6..c15c7e7 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 a3a0d63..bed86e2 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 6a1b426..004087c 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 5592323..a8ba29c 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 67ad9bb..1f81ea5 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -414,7 +414,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 621281b..cd1f774 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 ac31e16..c2cd5bd 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 1f9bddb..b7e959b 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 a4c02da..f0e2570 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' >-- >1.9.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 16154
:
49624
|
49625
|
49626
|
49627
|
50175
|
50176
|
50203
|
50204
|
50205
|
50206
|
50207
|
50229
|
50644
|
50645
|
50646
|
50647
|
50648
|
50752
|
50753
|
50754
|
50755
|
50756
|
50757
|
50758
|
50759
| 50760 |
50761