Bug 16154: Fix some other occurrences
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 13 Apr 2016 16:22:18 +0000 (17:22 +0100)
committerBrendan Gallagher <brendan@bywatersolutions.com>
Tue, 26 Apr 2016 23:16:44 +0000 (23:16 +0000)
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>

21 files changed:
acqui/histsearch.pl
admin/aqbudgetperiods.pl
admin/aqcontract.pl
admin/authorised_values.pl
admin/categories.pl
admin/matching-rules.pl
circ/circulation.pl
circ/overdue.pl
members/memberentry.pl
reserve/renewscript.pl
reserve/request.pl
serials/checkexpiration.pl
svc/checkouts
svc/renew
tools/exceptionHolidays.pl
tools/export.pl
tools/holidays.pl
tools/inventory.pl
tools/koha-news.pl
tools/scheduler.pl
virtualshelves/shelves.pl

index e9879c5..75949ee 100755 (executable)
@@ -76,8 +76,8 @@ my $ordernumber             = $input->param( 'ordernumber' );
 my $search_children_too     = $input->param( 'search_children_too' );
 my @created_by              = $input->multi_param('created_by');
 
-my $from_placed_on = eval { dt_from_string( $input->param('from') ) } || dt_from_string;
-my $to_placed_on   = eval { dt_from_string( $input->param('to')   ) } || dt_from_string;
+my $from_placed_on = eval { dt_from_string( scalar $input->param('from') ) } || dt_from_string;
+my $to_placed_on   = eval { dt_from_string( scalar $input->param('to')   ) } || dt_from_string;
 unless ( $input->param('from') ) {
     # Fill the form with year-1
     $from_placed_on->subtract( years => 1 );
index a6bf3b4..f7d8a46 100755 (executable)
@@ -72,8 +72,8 @@ my $op                   = $input->param('op')||"else";
 # get only the columns of aqbudgetperiods in budget_period_hashref
 my @columns = Koha::Database->new()->schema->source('Aqbudgetperiod')->columns;
 my $budget_period_hashref = { map { join(' ',@columns) =~ /$_/ ? ( $_ => scalar $input->param($_) )  : () } keys( %{$input->Vars()} ) } ;
-$budget_period_hashref->{budget_period_startdate} = dt_from_string( $input->param('budget_period_startdate') );
-$budget_period_hashref->{budget_period_enddate}   = dt_from_string( $input->param('budget_period_enddate') );
+$budget_period_hashref->{budget_period_startdate} = dt_from_string( scalar $input->param('budget_period_startdate') );
+$budget_period_hashref->{budget_period_enddate}   = dt_from_string( scalar $input->param('budget_period_enddate') );
 
 $searchfield =~ s/\,//g;
 
@@ -159,8 +159,8 @@ elsif ( $op eq 'duplicate_form'){
 elsif ( $op eq 'duplicate_budget' ){
     die "please specify a budget period id\n" if( !defined $budget_period_id || $budget_period_id eq '' );
 
-    my $budget_period_startdate = dt_from_string $input->param('budget_period_startdate');
-    my $budget_period_enddate   = dt_from_string $input->param('budget_period_enddate');
+    my $budget_period_startdate = dt_from_string scalar $input->param('budget_period_startdate');
+    my $budget_period_enddate   = dt_from_string scalar $input->param('budget_period_enddate');
     my $budget_period_description = $input->param('budget_period_description');
     my $amount_change_percentage = $input->param('amount_change_percentage');
     my $amount_change_round_increment = $input->param('amount_change_round_increment');
index dfe0fc0..57a9fce 100755 (executable)
@@ -93,8 +93,8 @@ elsif ( $op eq 'add_validate' ) {
 
     my $is_a_modif = $input->param("is_a_modif");
 
-    my $contractstart_dt = eval { dt_from_string( $input->param('contractstartdate') ); };
-    my $contractend_dt = eval { dt_from_string( $input->param('contractenddate') ); };
+    my $contractstart_dt = eval { dt_from_string( scalar $input->param('contractstartdate') ); };
+    my $contractend_dt = eval { dt_from_string( scalar $input->param('contractenddate') ); };
     unless ( $contractstart_dt and $contractend_dt ) {
         my $today = dt_from_string;
         $contractstart_dt ||= $today;
@@ -115,8 +115,8 @@ elsif ( $op eq 'add_validate' ) {
             contractname        => scalar $input->param('contractname'),
             contractdescription => scalar $input->param('contractdescription'),
             booksellerid        => scalar $input->param('booksellerid'),
-            contractstartdate   => eval { output_pref({ dt => dt_from_string( $input->param('contractstartdate') ), dateformat => 'iso', dateonly => 1 } ); },
-            contractenddate     => eval { output_pref({ dt => dt_from_string( $input->param('contractenddate') ), dateformat => 'iso', dateonly => 1 } ); },
+            contractstartdate   => eval { output_pref({ dt => dt_from_string( scalar $input->param('contractstartdate') ), dateformat => 'iso', dateonly => 1 } ); },
+            contractenddate     => eval { output_pref({ dt => dt_from_string( scalar $input->param('contractenddate') ), dateformat => 'iso', dateonly => 1 } ); },
         });
     }
 
index c7085dc..b782901 100755 (executable)
@@ -101,7 +101,7 @@ if ($op eq 'add_form') {
     my $imageurl     = $input->param( 'imageurl' ) || '';
     $imageurl = '' if $imageurl =~ /removeImage/;
     my $duplicate_entry = 0;
-    my @branches = grep { $_ ne q{} } $input->param('branches');
+    my @branches = grep { $_ ne q{} } $input->multi_param('branches');
 
     my $already_exists = Koha::AuthorisedValues->search(
         {
index f160e6e..7d4e8d3 100755 (executable)
@@ -91,7 +91,7 @@ elsif ( $op eq 'add_validate' ) {
     my $category_type = $input->param('category_type');
     my $BlockExpiredPatronOpacActions = $input->param('BlockExpiredPatronOpacActions');
     my $default_privacy = $input->param('default_privacy');
-    my @branches = grep { $_ ne q{} } $input->param('branches');
+    my @branches = grep { $_ ne q{} } $input->multi_param('branches');
 
     my $is_a_modif = $input->param("is_a_modif");
 
index 8753f0f..191d38b 100755 (executable)
@@ -96,18 +96,18 @@ sub add_update_matching_rule {
 
     # do parsing
     my $matcher = C4::Matcher->new($record_type, 1000);
-    $matcher->code($input->param('code'));
-    $matcher->description($input->param('description'));
-    $matcher->threshold($input->param('threshold'));
+    $matcher->code(scalar $input->param('code'));
+    $matcher->description(scalar $input->param('description'));
+    $matcher->threshold(scalar $input->param('threshold'));
 
     # matchpoints
-    my @mp_nums = sort map { /^mp_(\d+)_search_index/ ? int($1): () } $input->param;
+    my @mp_nums = sort map { /^mp_(\d+)_search_index/ ? int($1): () } $input->multi_param;
     foreach my $mp_num (@mp_nums) {
         my $index = $input->param("mp_${mp_num}_search_index");
         my $score = $input->param("mp_${mp_num}_score");
         # components
         my $components = [];
-        my @comp_nums = sort map { /^mp_${mp_num}_c_(\d+)_tag/ ? int($1): () } $input->param;
+        my @comp_nums = sort map { /^mp_${mp_num}_c_(\d+)_tag/ ? int($1): () } $input->multi_param;
         foreach my $comp_num (@comp_nums) {
             my $component = {};
             $component->{'tag'} = $input->param("mp_${mp_num}_c_${comp_num}_tag");
@@ -116,9 +116,9 @@ sub add_update_matching_rule {
             $component->{'length'} = $input->param("mp_${mp_num}_c_${comp_num}_length");
             # norms
             $component->{'norms'} = [];
-            my @norm_nums = sort map { /^mp_${mp_num}_c_${comp_num}_n_(\d+)_norm/ ? int($1): () } $input->param;
+            my @norm_nums = sort map { /^mp_${mp_num}_c_${comp_num}_n_(\d+)_norm/ ? int($1): () } $input->multi_param;
             foreach my $norm_num (@norm_nums) {
-                push @{ $component->{'norms'} }, $input->param("mp_${mp_num}_c_${comp_num}_n_${norm_num}_norm");
+                push @{ $component->{'norms'} }, $input->multi_param("mp_${mp_num}_c_${comp_num}_n_${norm_num}_norm");
             }
             push @$components, $component;
         }
@@ -126,11 +126,11 @@ sub add_update_matching_rule {
     }
 
     # match checks
-    my @mc_nums = sort map { /^mc_(\d+)_id/ ? int($1): () } $input->param;
+    my @mc_nums = sort map { /^mc_(\d+)_id/ ? int($1): () } $input->multi_param;
     foreach my $mc_num (@mc_nums) {
         # source components
         my $src_components = [];
-        my @src_comp_nums = sort map { /^mc_${mc_num}_src_c_(\d+)_tag/ ? int($1): () } $input->param;
+        my @src_comp_nums = sort map { /^mc_${mc_num}_src_c_(\d+)_tag/ ? int($1): () } $input->multi_param;
         foreach my $comp_num (@src_comp_nums) {
             my $component = {};
             $component->{'tag'} = $input->param("mc_${mc_num}_src_c_${comp_num}_tag");
@@ -139,15 +139,15 @@ sub add_update_matching_rule {
             $component->{'length'} = $input->param("mc_${mc_num}_src_c_${comp_num}_length");
             # norms
             $component->{'norms'} = [];
-            my @norm_nums = sort map { /^mc_${mc_num}_src_c_${comp_num}_n_(\d+)_norm/ ? int($1): () } $input->param;
+            my @norm_nums = sort map { /^mc_${mc_num}_src_c_${comp_num}_n_(\d+)_norm/ ? int($1): () } $input->multi_param;
             foreach my $norm_num (@norm_nums) {
-                push @{ $component->{'norms'} }, $input->param("mc_${mc_num}_src_c_${comp_num}_n_${norm_num}_norm");
+                push @{ $component->{'norms'} }, $input->multi_param("mc_${mc_num}_src_c_${comp_num}_n_${norm_num}_norm");
             }
             push @$src_components, $component;
         }
         # target components
         my $tgt_components = [];
-        my @tgt_comp_nums = sort map { /^mc_${mc_num}_tgt_c_(\d+)_tag/ ? int($1): () } $input->param;
+        my @tgt_comp_nums = sort map { /^mc_${mc_num}_tgt_c_(\d+)_tag/ ? int($1): () } $input->multi_param;
         foreach my $comp_num (@tgt_comp_nums) {
             my $component = {};
             $component->{'tag'} = $input->param("mc_${mc_num}_tgt_c_${comp_num}_tag");
@@ -156,9 +156,9 @@ sub add_update_matching_rule {
             $component->{'length'} = $input->param("mc_${mc_num}_tgt_c_${comp_num}_length");
             # norms
             $component->{'norms'} = [];
-            my @norm_nums = sort map { /^mc_${mc_num}_tgt_c_${comp_num}_n_(\d+)_norm/ ? int($1): () } $input->param;
+            my @norm_nums = sort map { /^mc_${mc_num}_tgt_c_${comp_num}_n_(\d+)_norm/ ? int($1): () } $input->multi_param;
             foreach my $norm_num (@norm_nums) {
-                push @{ $component->{'norms'} }, $input->param("mc_${mc_num}_tgt_c_${comp_num}_n_${norm_num}_norm");
+                push @{ $component->{'norms'} }, $input->multi_param("mc_${mc_num}_tgt_c_${comp_num}_n_${norm_num}_norm");
             }
             push @$tgt_components, $component;
         }
index 52cd2eb..4a38f71 100755 (executable)
@@ -107,7 +107,7 @@ if ( $barcode || $barcode eq '0' ) {
         push @$barcodes, split( /\s\n/, $list );
         $barcodes = [ map { $_ =~ /^\s*$/ ? () : $_ } @$barcodes ];
     } else {
-        @$barcodes = $query->param('barcodes');
+        @$barcodes = $query->multi_param('barcodes');
     }
 }
 
index 4fb046f..8e06013 100755 (executable)
@@ -102,8 +102,8 @@ $branchfilter = C4::Context->userenv->{'branch'} if ($onlymine && !$branchfilter
 #  %borrowernumber_to_attributes   is populated by those borrowernumbers matching the patron attribute filters
 
 my %cgi_attrcode_to_attrvalues;     # ( patron_attribute_code => [ zero or more attribute filter values from the CGI ] )
-for my $attrcode (grep { /^patron_attr_filter_/ } $input->param) {
-    if (my @attrvalues = grep { length($_) > 0 } $input->param($attrcode)) {
+for my $attrcode (grep { /^patron_attr_filter_/ } $input->multi_param) {
+    if (my @attrvalues = grep { length($_) > 0 } $input->multi_param($attrcode)) {
         $attrcode =~ s/^patron_attr_filter_//;
         $cgi_attrcode_to_attrvalues{$attrcode} = \@attrvalues;
         print STDERR ">>>param($attrcode)[@{[scalar @attrvalues]}] = '@attrvalues'\n" if $debug;
index 30b5beb..597c68d 100755 (executable)
@@ -711,7 +711,7 @@ output_html_with_http_headers $input, $cookie, $template->output;
 
 sub  parse_extended_patron_attributes {
     my ($input) = @_;
-    my @patron_attr = grep { /^patron_attr_\d+$/ } $input->param();
+    my @patron_attr = grep { /^patron_attr_\d+$/ } $input->multi_param();
 
     my @attr = ();
     my %dups = ();
index c2cd5bd..a1e7912 100755 (executable)
@@ -67,7 +67,7 @@ else {
 my $branch = $input->param('branch');
 my $datedue;
 if ( $input->param('newduedate') ) {
-    $datedue = dt_from_string( $input->param('newduedate') );
+    $datedue = dt_from_string( scalar $input->param('newduedate') );
     $datedue->set_hour(23);
     $datedue->set_minute(59);
 }
index 970596f..23ff0f3 100755 (executable)
@@ -132,7 +132,7 @@ my $biblionumbers = $input->param('biblionumbers');
 if ($multihold) {
     @biblionumbers = split '/', $biblionumbers;
 } else {
-    push @biblionumbers, $input->param('biblionumber');
+    push @biblionumbers, $input->multi_param('biblionumber');
 }
 
 
index 9f1ff14..e4fa9ce 100755 (executable)
@@ -71,7 +71,7 @@ my $title = $query->param('title');
 my $issn  = $query->param('issn');
 my $branch = $query->param('branch');
 my $date = $query->param('date');
-$date = eval { dt_from_string( $query->param('date') ) } if $date;
+$date = eval { dt_from_string( scalar $query->param('date') ) } if $date;
 
 if ($date) {
     my @subscriptions = SearchSubscriptions({ title => $title, issn => $issn, orderby => 'title' });
index 93a1c95..e613126 100755 (executable)
@@ -47,7 +47,7 @@ unless (haspermission($userid, { circulate => 'circulate_remaining_permissions'
 
 my @sort_columns = qw/date_due title itype issuedate branchcode itemcallnumber/;
 
-my @borrowernumber   = $input->param('borrowernumber');
+my @borrowernumber   = $input->multi_param('borrowernumber');
 my $offset           = $input->param('iDisplayStart');
 my $results_per_page = $input->param('iDisplayLength') || -1;
 
index 33ac4fa..1aa9a28 100755 (executable)
--- a/svc/renew
+++ b/svc/renew
@@ -48,7 +48,7 @@ my $branchcode     = $input->param('branchcode')
   || C4::Context->userenv->{'branch'};
 my $date_due;
 if ( $input->param('date_due') ) {
-    $date_due = dt_from_string( $input->param('date_due') );
+    $date_due = dt_from_string( scalar $input->param('date_due') );
 }
 
 my $data;
index 0b1818d..2855189 100755 (executable)
@@ -23,7 +23,7 @@ my $year = $input->param('showYear');
 my $title = $input->param('showTitle');
 my $description = $input->param('showDescription');
 my $holidaytype = $input->param('showHolidayType');
-my $datecancelrange_dt = eval { dt_from_string( $input->param('datecancelrange') ) };
+my $datecancelrange_dt = eval { dt_from_string( scalar $input->param('datecancelrange') ) };
 my $calendardate = sprintf("%04d-%02d-%02d", $year, $month, $day);
 
 my $calendar = C4::Calendar->new(branchcode => $branchcode);
index f0e2570..4794d05 100755 (executable)
@@ -105,11 +105,11 @@ if ( $op eq "export" ) {
                 my $end_callnumber       = $query->param("end_callnumber");
                 my $start_accession =
                   ( $query->param("start_accession") )
-                  ? dt_from_string( $query->param("start_accession") )
+                  ? dt_from_string( scalar $query->param("start_accession") )
                   : '';
                 my $end_accession =
                   ( $query->param("end_accession") )
-                  ? dt_from_string( $query->param("end_accession") )
+                  ? dt_from_string( scalar $query->param("end_accession") )
                   : '';
 
 
index 109aa7c..74fa036 100755 (executable)
@@ -43,7 +43,7 @@ my ($template, $loggedinuser, $cookie)
 
 # calendardate - date passed in url for human readability (syspref)
 # if the url has an invalid date default to 'now.'
-my $calendarinput_dt = eval { dt_from_string( $input->param('calendardate') ); } || dt_from_string;
+my $calendarinput_dt = eval { dt_from_string( scalar $input->param('calendardate') ); } || dt_from_string;
 my $calendardate = output_pref( { dt => $calendarinput_dt, dateonly => 1 } );
 
 # keydate - date passed to calendar.js.  calendar.js does not process dashes within a date.
index 2192dbd..990855f 100755 (executable)
@@ -151,7 +151,7 @@ my @scanned_items;
 my @errorloop;
 if ( $uploadbarcodes && length($uploadbarcodes) > 0 ) {
     my $dbh = C4::Context->dbh;
-    my $date = dt_from_string( $input->param('setdate') );
+    my $date = dt_from_string( scalar $input->param('setdate') );
     $date = output_pref ( { dt => $date, dateformat => 'iso' } );
 
     my $strsth  = "select * from issues, items where items.itemnumber=issues.itemnumber and items.barcode =?";
index e344bfa..d5f2c5b 100755 (executable)
@@ -40,8 +40,8 @@ my $cgi = new CGI;
 my $id             = $cgi->param('id');
 my $title          = $cgi->param('title');
 my $new            = $cgi->param('new');
-my $expirationdate = output_pref({ dt => dt_from_string( $cgi->param('expirationdate') ), dateformat => 'iso', dateonly => 1 });
-my $timestamp      = output_pref({ dt => dt_from_string( $cgi->param('timestamp') ), dateformat => 'iso', dateonly => 1 });
+my $expirationdate = output_pref({ dt => dt_from_string( scalar $cgi->param('expirationdate') ), dateformat => 'iso', dateonly => 1 });
+my $timestamp      = output_pref({ dt => dt_from_string( scalar $cgi->param('timestamp') ), dateformat => 'iso', dateonly => 1 });
 my $number         = $cgi->param('number');
 my $lang           = $cgi->param('lang');
 my $branchcode     = $cgi->param('branch');
index cb1bad3..809ffae 100755 (executable)
@@ -62,7 +62,7 @@ my $id   = $input->param('id');
 if ( $mode eq 'job_add' ) {
 
     # Retrieving the date according to the dateformat syspref
-    my $c4date = output_pref({ dt => dt_from_string( $input->param('startdate') ), dateformat => 'iso', dateonly => 1 });
+    my $c4date = output_pref({ dt => dt_from_string( scalar $input->param('startdate') ), dateformat => 'iso', dateonly => 1 });
 
     # Formatting it for Schedule::At
     my $startdate = join('', (split /-/, $c4date));
index 0d6006b..1278305 100755 (executable)
@@ -92,12 +92,12 @@ if ( $op eq 'add_form' ) {
     if ( $shelf ) {
         $op = $referer;
         if ( $shelf->can_be_managed( $loggedinuser ) ) {
-            $shelf->shelfname( $query->param('shelfname') );
-            $shelf->sortfield( $query->param('sortfield') );
-            $shelf->allow_add( $query->param('allow_add') );
-            $shelf->allow_delete_own( $query->param('allow_delete_own') );
-            $shelf->allow_delete_other( $query->param('allow_delete_other') );
-            $shelf->category( $query->param('category') );
+            $shelf->shelfname( scalar $query->param('shelfname') );
+            $shelf->sortfield( scalar $query->param('sortfield') );
+            $shelf->allow_add( scalar $query->param('allow_add') );
+            $shelf->allow_delete_own( scalar $query->param('allow_delete_own') );
+            $shelf->allow_delete_other( scalar $query->param('allow_delete_other') );
+            $shelf->category( scalar $query->param('category') );
             eval { $shelf->store };
 
             if ($@) {