From 83b1f1226e39f191689dfe6818d5adb958c262b3 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 15 Apr 2016 09:00:28 +0100 Subject: [PATCH] Bug 16259: Replace CGI->param with CGI->multi_param in list context - part 2 This patch is a follow-up of bug 16154. It removes the warning "CGI::param called in list context" in the following scripts: admin/branches.pl admin/categories.pl admin/patron-attr-types.pl admin/preferences.pl catalogue/image.pl circ/circulation.pl patroncards/add_user_search.pl serials/add_user_search.pl tools/marc_modification_templates.pl virtualshelves/shelves.pl Note that the warning from catalogue/itemsearch.pl still exists (the call to CGI->param is done from the template). Test plan: - Add/modify a library, patron category, patron attr type - Update a syspref - Set localcoverimage and call catalogue/image.pl?biblionumber=XXX - Search for patrons in the patron cards or serials module - Add a marc modification templates - Add a list (shelves) You should not get the warning in the log after all these actions. Signed-off-by: Owen Leonard Signed-off-by: Katrin Fischer Signed-off-by: Kyle M Hall (cherry picked from commit 7f3feacfe3897affbf76531eb3abd8cbc88a81e9) Signed-off-by: Julian Maurice --- C4/Form/MessagingPreferences.pm | 4 ++-- admin/patron-attr-types.pl | 4 ++-- catalogue/image.pl | 2 +- circ/circulation.pl | 2 +- svc/config/systempreferences | 2 +- tools/marc_modification_templates.pl | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/C4/Form/MessagingPreferences.pm b/C4/Form/MessagingPreferences.pm index bb981a6d8f..5f1b5cc006 100644 --- a/C4/Form/MessagingPreferences.pm +++ b/C4/Form/MessagingPreferences.pm @@ -81,11 +81,11 @@ sub handle_form_action { message_attribute_id => $option->{'message_attribute_id'} }; # find the desired transports - @{$updater->{'message_transport_types'}} = $query->param( $option->{'message_attribute_id'} ); + @{$updater->{'message_transport_types'}} = $query->multi_param( $option->{'message_attribute_id'} ); next OPTION unless $updater->{'message_transport_types'}; if ( $option->{'has_digest'} ) { - if ( List::Util::first { $_ == $option->{'message_attribute_id'} } $query->param( 'digest' ) ) { + if ( List::Util::first { $_ == $option->{'message_attribute_id'} } $query->multi_param( 'digest' ) ) { $updater->{'wants_digest'} = 1; } } diff --git a/admin/patron-attr-types.pl b/admin/patron-attr-types.pl index 4cc2247987..2965bbd4f5 100755 --- a/admin/patron-attr-types.pl +++ b/admin/patron-attr-types.pl @@ -171,8 +171,8 @@ sub add_update_attribute_type { $attr_type->password_allowed($password_allowed); my $display_checkout = $input->param('display_checkout'); $attr_type->display_checkout($display_checkout); - $attr_type->category_code($input->param('category_code')); - $attr_type->class($input->param('class')); + $attr_type->category_code(scalar $input->param('category_code')); + $attr_type->class(scalar $input->param('class')); my @branches = $input->multi_param('branches'); $attr_type->branches( \@branches ); diff --git a/catalogue/image.pl b/catalogue/image.pl index f347640652..3d95b0584c 100755 --- a/catalogue/image.pl +++ b/catalogue/image.pl @@ -64,7 +64,7 @@ if ( C4::Context->preference("LocalCoverImages") ) { $imagenumber = $data->param('imagenumber'); } elsif ( defined $data->param('biblionumber') ) { - my @imagenumbers = ListImagesForBiblio( $data->param('biblionumber') ); + my @imagenumbers = ListImagesForBiblio( $data->multi_param('biblionumber') ); if (@imagenumbers) { $imagenumber = $imagenumbers[0]; } diff --git a/circ/circulation.pl b/circ/circulation.pl index 1a6d0fbcc1..f02840e0fe 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -176,7 +176,7 @@ if ( @$barcodes ) { $stickyduedate = $query->param('stickyduedate'); $duedatespec = $query->param('duedatespec'); } - $session->param('auto_renew', $query->param('auto_renew')); + $session->param('auto_renew', scalar $query->param('auto_renew')); } else { $session->clear('auto_renew'); diff --git a/svc/config/systempreferences b/svc/config/systempreferences index 021db3c898..01cd782dc4 100755 --- a/svc/config/systempreferences +++ b/svc/config/systempreferences @@ -94,7 +94,7 @@ sub set_preferences { next if ( !defined( $pref ) ); - my $value = join( ',', $query->param( $param ) ); + my $value = join( ',', $query->multi_param( $param ) ); C4::Context->set_preference( $pref, $value ); } diff --git a/tools/marc_modification_templates.pl b/tools/marc_modification_templates.pl index 10589e4141..3689684c51 100755 --- a/tools/marc_modification_templates.pl +++ b/tools/marc_modification_templates.pl @@ -42,7 +42,7 @@ my ($template, $loggedinuser, $cookie) if ( $op eq "create_template" ) { $template_id = '' unless $cgi->param('duplicate_current_template'); - $template_id = AddModificationTemplate( $cgi->param('template_name'), $template_id ); + $template_id = AddModificationTemplate( scalar $cgi->param('template_name'), $template_id ); } elsif ( $op eq "delete_template" ) { @@ -103,11 +103,11 @@ if ( $op eq "create_template" ) { } } elsif ( $op eq "delete_action" ) { - DelModificationTemplateAction( $cgi->param('mmta_id') ); + DelModificationTemplateAction( scalar $cgi->param('mmta_id') ); } elsif ( $op eq "move_action" ) { - MoveModificationTemplateAction( $cgi->param('mmta_id'), $cgi->param('where') ); + MoveModificationTemplateAction( scalar $cgi->param('mmta_id'), scalar $cgi->param('where') ); } -- 2.39.5