Browse Source

Bug 18632: Remove 'CGI::param called in list context' warnings

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>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
17.05.x
Jonathan Druart 4 years ago
committed by Kyle M Hall
parent
commit
a80366439e
  1. 6
      admin/authorised_values.pl
  2. 21
      admin/classsources.pl
  3. 24
      admin/edi_accounts.pl
  4. 2
      admin/import_export_framework.pl
  5. 2
      admin/patron-attr-types.pl
  6. 8
      clubs/clubs-add-modify.pl
  7. 10
      clubs/templates-add-modify.pl
  8. 2
      installer/install.pl
  9. 44
      members/housebound.pl
  10. 2
      opac/opac-overdrive-search.pl
  11. 4
      opac/opac-user.pl

6
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' };

21
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;

24
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

2
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));
}

2
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'),
);
}

8
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(),

10
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();

2
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

44
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' }

2
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;

4
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(

Loading…
Cancel
Save