Bugzilla – Attachment 63727 Details for
Bug 18632
CGI::param called in list context flooding error logs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18632: Remove 'CGI::param called in list context' warnings
Bug-18632-Remove-CGIparam-called-in-list-context-w.patch (text/plain), 17.47 KB, created by
Marcel de Rooy
on 2017-05-26 06:19:50 UTC
(
hide
)
Description:
Bug 18632: Remove 'CGI::param called in list context' warnings
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2017-05-26 06:19:50 UTC
Size:
17.47 KB
patch
obsolete
>From 2d292d1cb3f559b86f0affed328d6d18278b5038 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 18 May 2017 17:42:02 -0300 >Subject: [PATCH] Bug 18632: Remove 'CGI::param called in list context' > warnings >Content-Type: text/plain; charset=utf-8 > >Once again, after bug 16154 and bug 16259 we need to remove more >occurrence of CGi->param called in list context. >Refer to bug 15809 for more information. > >Test plan: >Make sure you do not see the error on the modified scripts. > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > admin/authorised_values.pl | 6 +++--- > admin/classsources.pl | 21 ++++++++++--------- > admin/edi_accounts.pl | 24 +++++++++++----------- > admin/import_export_framework.pl | 2 +- > admin/patron-attr-types.pl | 2 +- > clubs/clubs-add-modify.pl | 8 ++++---- > clubs/templates-add-modify.pl | 10 ++++----- > installer/install.pl | 2 +- > members/housebound.pl | 44 ++++++++++++++++++++-------------------- > opac/opac-overdrive-search.pl | 2 +- > opac/opac-user.pl | 4 ++-- > 11 files changed, 63 insertions(+), 62 deletions(-) > >diff --git a/admin/authorised_values.pl b/admin/authorised_values.pl >index bb94e23..272ed00 100755 >--- a/admin/authorised_values.pl >+++ b/admin/authorised_values.pl >@@ -119,8 +119,8 @@ if ($op eq 'add_form') { > elsif ( $id ) { # Update > my $av = Koha::AuthorisedValues->new->find( $id ); > >- $av->lib( $input->param('lib') || undef ); >- $av->lib_opac( $input->param('lib_opac') || undef ); >+ $av->lib( scalar $input->param('lib') || undef ); >+ $av->lib_opac( scalar $input->param('lib_opac') || undef ); > $av->category( $new_category ); > $av->authorised_value( $new_authorised_value ); > $av->imageurl( $imageurl ); >@@ -192,7 +192,7 @@ if ($op eq 'add_form') { > > $op = 'list'; > } elsif ($op eq 'delete') { >- my $av = Koha::AuthorisedValues->new->find( $input->param('id') ); >+ my $av = Koha::AuthorisedValues->new->find( $id ); > my $deleted = eval {$av->delete}; > if ( $@ or not $deleted ) { > push @messages, {type => 'error', code => 'error_on_delete' }; >diff --git a/admin/classsources.pl b/admin/classsources.pl >index 74e682a..539095f 100755 >--- a/admin/classsources.pl >+++ b/admin/classsources.pl >@@ -34,7 +34,7 @@ my $input = new CGI; > my $op = $input->param('op') || ''; > my $source_code = $input->param('class_source'); > my $rule_code = $input->param('sort_rule'); >- >+my $sort_routine = $input->param('sort_routine'); > my ($template, $loggedinuser, $cookie) > = get_template_and_user({template_name => "admin/classsources.tt", > query => $input, >@@ -46,15 +46,16 @@ my ($template, $loggedinuser, $cookie) > > $template->param(script_name => $script_name); > $template->param($op => 1) if $op; >- >+my $description = $input->param('description'); >+my $used = $input->param('used'); > my $display_lists = 0; > if ($op eq "add_source") { > add_class_source_form($template); > } elsif ($op eq "add_source_confirmed") { > add_class_source($template, > $source_code, >- $input->param('description'), >- $input->param('used') eq "used" ? 1 : 0, >+ $description, >+ $used eq "used" ? 1 : 0, > $rule_code); > $display_lists = 1; > } elsif ($op eq "delete_source") { >@@ -67,8 +68,8 @@ if ($op eq "add_source") { > } elsif ($op eq "edit_source_confirmed") { > edit_class_source($template, > $source_code, >- $input->param('description'), >- $input->param('used') eq "used" ? 1 : 0, >+ $description, >+ $used eq "used" ? 1 : 0, > $rule_code); > $display_lists = 1; > } elsif ($op eq "add_sort_rule") { >@@ -76,8 +77,8 @@ if ($op eq "add_source") { > } elsif ($op eq "add_sort_rule_confirmed") { > add_class_sort_rule($template, > $rule_code, >- $input->param('description'), >- $input->param('sort_routine')); >+ $description, >+ $sort_routine); > $display_lists = 1; > } elsif ($op eq "delete_sort_rule") { > delete_sort_rule_form($template, $rule_code); >@@ -89,8 +90,8 @@ if ($op eq "add_source") { > } elsif ($op eq "edit_sort_rule_confirmed") { > edit_class_sort_rule($template, > $rule_code, >- $input->param('description'), >- $input->param('sort_routine')); >+ $description, >+ $sort_routine); > $display_lists = 1; > } else { > $display_lists = 1; >diff --git a/admin/edi_accounts.pl b/admin/edi_accounts.pl >index eeab341..9225b7c 100755 >--- a/admin/edi_accounts.pl >+++ b/admin/edi_accounts.pl >@@ -73,22 +73,22 @@ else { > # validate & display > my $id = $input->param('id'); > my $fields = { >- description => $input->param('description'), >- host => $input->param('host'), >- username => $input->param('username'), >- password => $input->param('password'), >- vendor_id => $input->param('vendor_id'), >- upload_directory => $input->param('upload_directory'), >- download_directory => $input->param('download_directory'), >- san => $input->param('san'), >- transport => $input->param('transport'), >+ description => scalar $input->param('description'), >+ host => scalar $input->param('host'), >+ username => scalar $input->param('username'), >+ password => scalar $input->param('password'), >+ vendor_id => scalar $input->param('vendor_id'), >+ upload_directory => scalar $input->param('upload_directory'), >+ download_directory => scalar $input->param('download_directory'), >+ san => scalar $input->param('san'), >+ transport => scalar $input->param('transport'), > quotes_enabled => defined $input->param('quotes_enabled'), > invoices_enabled => defined $input->param('invoices_enabled'), > orders_enabled => defined $input->param('orders_enabled'), > responses_enabled => defined $input->param('responses_enabled'), > auto_orders => defined $input->param('auto_orders'), >- id_code_qualifier => $input->param('id_code_qualifier'), >- plugin => $input->param('plugin'), >+ id_code_qualifier => scalar $input->param('id_code_qualifier'), >+ plugin => scalar $input->param('plugin'), > }; > > if ($id) { >@@ -105,7 +105,7 @@ else { > elsif ( $op eq 'delete_confirmed' ) { > > $schema->resultset('VendorEdiAccount') >- ->search( { id => $input->param('id'), } )->delete_all; >+ ->search( { id => scalar $input->param('id'), } )->delete_all; > } > > # we do a default dispaly after deletes and saves >diff --git a/admin/import_export_framework.pl b/admin/import_export_framework.pl >index b2d090d..de1f195 100755 >--- a/admin/import_export_framework.pl >+++ b/admin/import_export_framework.pl >@@ -84,7 +84,7 @@ if ($action eq 'export' && $input->request_method() eq 'GET') { > my $extension = $1; > my $uploadFd = $input->upload($fieldname); > if ($uploadFd && !$input->cgi_error) { >- my $tmpfilename = $input->tmpFileName($input->param($fieldname)); >+ my $tmpfilename = $input->tmpFileName(scalar $input->param($fieldname)); > $filename = $tmpfilename . '.' . $extension; # rename the tmp file with the extension > $ok = ImportFramework($filename, $frameworkcode, 1) if (rename($tmpfilename, $filename)); > } >diff --git a/admin/patron-attr-types.pl b/admin/patron-attr-types.pl >index 178bf37..ca4e190 100755 >--- a/admin/patron-attr-types.pl >+++ b/admin/patron-attr-types.pl >@@ -135,7 +135,7 @@ sub error_add_attribute_type_form { > $template->param( > attribute_type_form => 1, > confirm_op => 'add_attribute_type_confirmed', >- authorised_value_category => $input->param('authorised_value_category'), >+ authorised_value_category => scalar $input->param('authorised_value_category'), > ); > } > >diff --git a/clubs/clubs-add-modify.pl b/clubs/clubs-add-modify.pl >index 9d0ff08..dabac24 100755 >--- a/clubs/clubs-add-modify.pl >+++ b/clubs/clubs-add-modify.pl >@@ -64,10 +64,10 @@ $date_end = $date_end ? dt_from_string($date_end) : undef; > if ( $cgi->param('name') ) { # Update or create club > $club->set( > { >- club_template_id => $cgi->param('club_template_id') || undef, >- name => $cgi->param('name') || undef, >- description => $cgi->param('description') || undef, >- branchcode => $cgi->param('branchcode') || undef, >+ club_template_id => scalar $cgi->param('club_template_id') || undef, >+ name => scalar $cgi->param('name') || undef, >+ description => scalar $cgi->param('description') || undef, >+ branchcode => scalar $cgi->param('branchcode') || undef, > date_start => $date_start, > date_end => $date_end, > date_updated => dt_from_string(), >diff --git a/clubs/templates-add-modify.pl b/clubs/templates-add-modify.pl >index ae46178..254a99e 100755 >--- a/clubs/templates-add-modify.pl >+++ b/clubs/templates-add-modify.pl >@@ -62,12 +62,12 @@ if ( $cgi->param('name') ) { # Update or create club > $club_template->set( > { > id => $id || undef, >- name => $cgi->param('name') || undef, >- description => $cgi->param('description') || undef, >- branchcode => $cgi->param('branchcode') || undef, >+ name => scalar $cgi->param('name') || undef, >+ description => scalar $cgi->param('description') || undef, >+ branchcode => scalar $cgi->param('branchcode') || undef, > date_updated => dt_from_string(), >- is_email_required => $cgi->param('is_email_required') ? 1 : 0, >- is_enrollable_from_opac => $cgi->param('is_enrollable_from_opac') ? 1 : 0, >+ is_email_required => scalar $cgi->param('is_email_required') ? 1 : 0, >+ is_enrollable_from_opac => scalar $cgi->param('is_enrollable_from_opac') ? 1 : 0, > } > )->store(); > >diff --git a/installer/install.pl b/installer/install.pl >index 3056ddc..e4efda7 100755 >--- a/installer/install.pl >+++ b/installer/install.pl >@@ -245,7 +245,7 @@ elsif ( $step && $step == 3 ) { > > my ( $fwk_language, $list ) = > $installer->load_sql_in_order( $all_languages, >- $query->param('framework') ); >+ scalar $query->param('framework') ); > $template->param( > "fwklanguage" => $fwk_language, > "list" => $list >diff --git a/members/housebound.pl b/members/housebound.pl >index def6c57..0ffe685 100755 >--- a/members/housebound.pl >+++ b/members/housebound.pl >@@ -86,13 +86,13 @@ if ( $method eq 'updateconfirm' and $houseboundprofile ) { > # We have received the input from the profile edit form. We must save the > # changes, and return to simple display. > $houseboundprofile->set({ >- day => $input->param('day') // q{}, >- frequency => $input->param('frequency') // q{}, >- fav_itemtypes => $input->param('fav_itemtypes') // q{}, >- fav_subjects => $input->param('fav_subjects') // q{}, >- fav_authors => $input->param('fav_authors') // q{}, >- referral => $input->param('referral') // q{}, >- notes => $input->param('notes') // q{}, >+ day => scalar $input->param('day') // q{}, >+ frequency => scalar $input->param('frequency') // q{}, >+ fav_itemtypes => scalar $input->param('fav_itemtypes') // q{}, >+ fav_subjects => scalar $input->param('fav_subjects') // q{}, >+ fav_authors => scalar $input->param('fav_authors') // q{}, >+ referral => scalar $input->param('referral') // q{}, >+ notes => scalar $input->param('notes') // q{}, > }); > my $success = eval { return $houseboundprofile->store }; > push @messages, { type => 'error', code => 'error_on_profile_store' } >@@ -103,13 +103,13 @@ if ( $method eq 'updateconfirm' and $houseboundprofile ) { > # save it, and return to simple display. > $houseboundprofile = Koha::Patron::HouseboundProfile->new({ > borrowernumber => $patron->borrowernumber, >- day => $input->param('day') // q{}, >- frequency => $input->param('frequency') // q{}, >- fav_itemtypes => $input->param('fav_itemtypes') // q{}, >- fav_subjects => $input->param('fav_subjects') // q{}, >- fav_authors => $input->param('fav_authors') // q{}, >- referral => $input->param('referral') // q{}, >- notes => $input->param('notes') // q{}, >+ day => scalar $input->param('day') // q{}, >+ frequency => scalar $input->param('frequency') // q{}, >+ fav_itemtypes => scalar $input->param('fav_itemtypes') // q{}, >+ fav_subjects => scalar $input->param('fav_subjects') // q{}, >+ fav_authors => scalar $input->param('fav_authors') // q{}, >+ referral => scalar $input->param('referral') // q{}, >+ notes => scalar $input->param('notes') // q{}, > }); > my $success = eval { return $houseboundprofile->store }; > push @messages, { type => 'error', code => 'error_on_profile_create' } >@@ -130,11 +130,11 @@ if ( $method eq 'updateconfirm' and $houseboundprofile ) { > # We have received input for editing a visit. We must store and return to > # simple display. > $visit->set({ >- borrowernumber => $input->param('borrowernumber') // q{}, >+ borrowernumber => scalar $input->param('borrowernumber') // q{}, > appointment_date => dt_from_string($input->param('date') // q{}), >- day_segment => $input->param('segment') // q{}, >- chooser_brwnumber => $input->param('chooser') // q{}, >- deliverer_brwnumber => $input->param('deliverer') // q{}, >+ day_segment => scalar $input->param('segment') // q{}, >+ chooser_brwnumber => scalar $input->param('chooser') // q{}, >+ deliverer_brwnumber => scalar $input->param('deliverer') // q{}, > }); > my $success = eval { return $visit->store }; > push @messages, { type => 'error', code => 'error_on_visit_store' } >@@ -144,11 +144,11 @@ if ( $method eq 'updateconfirm' and $houseboundprofile ) { > # We have received input for creating a visit. We must store and return > # to simple display. > my $visit = Koha::Patron::HouseboundVisit->new({ >- borrowernumber => $input->param('borrowernumber') // q{}, >+ borrowernumber => scalar $input->param('borrowernumber') // q{}, > appointment_date => dt_from_string($input->param('date') // q{}), >- day_segment => $input->param('segment') // q{}, >- chooser_brwnumber => $input->param('chooser') // q{}, >- deliverer_brwnumber => $input->param('deliverer') // q{}, >+ day_segment => scalar $input->param('segment') // q{}, >+ chooser_brwnumber => scalar $input->param('chooser') // q{}, >+ deliverer_brwnumber => scalar $input->param('deliverer') // q{}, > }); > my $success = eval { return $visit->store }; > push @messages, { type => 'error', code => 'error_on_visit_create' } >diff --git a/opac/opac-overdrive-search.pl b/opac/opac-overdrive-search.pl >index 1f8304b..3c10fde 100755 >--- a/opac/opac-overdrive-search.pl >+++ b/opac/opac-overdrive-search.pl >@@ -41,6 +41,6 @@ $template->{'VARS'}->{'q'} = $cgi->param('q'); > $template->{'VARS'}->{'limit'} = C4::Context->preference('OPACnumSearchResults') || 20; > $template->{'VARS'}->{'OPACnumSearchResults'} = C4::Context->preference('OPACnumSearchResults') || 20; > $template->{'VARS'}->{'OverDriveLibraryID'} = C4::Context->preference('OverDriveLibraryID'); >-$template->param(overdrive_error => $cgi->param('overdrive_error')); >+$template->param(overdrive_error => scalar $cgi->param('overdrive_error')); > > output_html_with_http_headers $cgi, $cookie, $template->output; >diff --git a/opac/opac-user.pl b/opac/opac-user.pl >index 3618a30..00e5a97 100755 >--- a/opac/opac-user.pl >+++ b/opac/opac-user.pl >@@ -318,8 +318,8 @@ if (C4::Context->preference("OPACAmazonCoverImages") or > > $template->param( > OverDriveCirculation => C4::Context->preference('OverDriveCirculation') || 0, >- overdrive_error => $query->param('overdrive_error') || undef, >- overdrive_tab => $query->param('overdrive_tab') || 0, >+ overdrive_error => scalar $query->param('overdrive_error') || undef, >+ overdrive_tab => scalar $query->param('overdrive_tab') || 0, > ); > > my $patron_messages = Koha::Patron::Messages->search( >-- >2.1.4
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 18632
:
63548
|
63610
|
63727
|
65072