Bug 16154: CGI->multi_param - Force scalar context
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 29 Mar 2016 08:51:07 +0000 (09:51 +0100)
committerBrendan Gallagher <brendan@bywatersolutions.com>
Tue, 26 Apr 2016 23:16:43 +0000 (23:16 +0000)
This patch replaces the occurrences of
  $template->param( foo => $cgi->param('foo') );
with
  $template->param( foo => scalar $cgi->param('foo') );

perl -p -i -e 's/(\s*=>\s*)\$(cgi|input|query)\->param\(/$1scalar
\$$2\->param\(/xms' **/*.pl

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>

57 files changed:
acqui/invoice-files.pl
acqui/invoice.pl
admin/aqbudgetperiods.pl
admin/aqbudgets.pl
admin/aqcontract.pl
admin/authorised_values.pl
admin/branches.pl
admin/categories.pl
admin/patron-attr-types.pl
admin/z3950servers.pl
authorities/auth_finder.pl
catalogue/ISBDdetail.pl
catalogue/MARCdetail.pl
catalogue/detail.pl
catalogue/itemsearch.pl
catalogue/labeledMARCdetail.pl
cataloguing/addbiblio.pl
cataloguing/additem.pl
cataloguing/merge.pl
cataloguing/plugin_launcher.pl
cataloguing/value_builder/EXAMPLE.pl
cataloguing/value_builder/marc21_linking_section.pl
cataloguing/value_builder/unimarc_field_210c.pl
cataloguing/value_builder/unimarc_field_4XX.pl
cataloguing/z3950_auth_search.pl
circ/circulation.pl
circ/returns.pl
circ/selectbranchprinter.pl
course_reserves/add_items.pl
course_reserves/course-details.pl
labels/label-edit-layout.pl
labels/label-edit-profile.pl
labels/label-edit-template.pl
members/files.pl
members/member.pl
members/memberentry.pl
members/mod_debarment.pl
members/moremember.pl
members/nl-search.pl
members/paycollect.pl
opac/opac-account.pl
opac/opac-review.pl
opac/opac-search.pl
opac/opac-serial-issues.pl
opac/opac-shelves.pl
opac/opac-topissues.pl
opac/opac-user.pl
patron_lists/list.pl
patroncards/edit-profile.pl
patroncards/edit-template.pl
reports/guided_reports.pl
serials/serial-issues.pl
serials/serials-collection.pl
serials/showpredictionpattern.pl
serials/subscription-add.pl
serials/subscription-renew.pl
virtualshelves/shelves.pl

index 635c427..ce674e4 100755 (executable)
@@ -102,7 +102,7 @@ else {
                     name    => $filename,
                     type    => $mimetype,
                     content => $file_content,
-                    description => $input->param('description')
+                    description => scalar $input->param('description')
                 );
             }
         }
@@ -110,7 +110,7 @@ else {
             $errors{'no_file'} = 1;
         }
     } elsif ( $op eq 'delete' ) {
-        $mf->DelFile( id => $input->param('file_id') );
+        $mf->DelFile( id => scalar $input->param('file_id') );
     }
 
     $template->param(
index ab01a14..08e3ee8 100755 (executable)
@@ -82,8 +82,8 @@ elsif ( $op && $op eq 'mod' ) {
     my $shipment_budget_id = $input->param('shipment_budget_id');
     ModInvoice(
         invoiceid             => $invoiceid,
-        shipmentdate          => output_pref( { str => $input->param('shipmentdate'), dateformat => 'iso', dateonly => 1 } ),
-        billingdate           => output_pref( { str => $input->param('billingdate'),  dateformat => 'iso', dateonly => 1 } ),
+        shipmentdate          => output_pref( { str => scalar $input->param('shipmentdate'), dateformat => 'iso', dateonly => 1 } ),
+        billingdate           => output_pref( { str => scalar $input->param('billingdate'),  dateformat => 'iso', dateonly => 1 } ),
         shipmentcost          => $shipmentcost,
         shipmentcost_budgetid => $shipment_budget_id
     );
index 2800a98..a6bf3b4 100755 (executable)
@@ -71,7 +71,7 @@ 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) =~ /$_/ ? ( $_ => $input->param($_) )  : () } keys( %{$input->Vars()} ) } ;
+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') );
 
index 0d18131..0e6b744 100755 (executable)
@@ -69,7 +69,7 @@ if (not defined $template->{VARS}->{'CAN_user_acquisition_budget_add_del'}
 
 # get only the columns of aqbudgets in budget_hash
 my @columns = Koha::Database->new()->schema->source('Aqbudget')->columns;
-my $budget_hash = { map { join(' ',@columns) =~ /$_/ ? ( $_ => $input->param($_) )  : () } keys( %{$input->Vars()}) } ;
+my $budget_hash = { map { join(' ',@columns) =~ /$_/ ? ( $_ => scalar $input->param($_) )  : () } keys( %{$input->Vars()}) } ;
 
 my $budget_id                 = $input->param('budget_id');
 my $budget_period_id          = $input->param('budget_period_id');
index a191cd8..dfe0fc0 100755 (executable)
@@ -105,16 +105,16 @@ elsif ( $op eq 'add_validate' ) {
         ModContract({
             contractstartdate   => eval { output_pref({ dt => dt_from_string( $contractstart_dt ), dateformat => 'iso', dateonly => 1 } ); },
             contractenddate     => eval { output_pref({ dt => dt_from_string( $contractend_dt ), dateformat => 'iso', dateonly => 1 } ); },
-            contractname        => $input->param('contractname'),
-            contractdescription => $input->param('contractdescription'),
-            booksellerid        => $input->param('booksellerid'),
-            contractnumber      => $input->param('contractnumber'),
+            contractname        => scalar $input->param('contractname'),
+            contractdescription => scalar $input->param('contractdescription'),
+            booksellerid        => scalar $input->param('booksellerid'),
+            contractnumber      => scalar $input->param('contractnumber'),
         });
     } else {
         AddContract({
-            contractname        => $input->param('contractname'),
-            contractdescription => $input->param('contractdescription'),
-            booksellerid        => $input->param('booksellerid'),
+            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 } ); },
         });
index 0f00126..c7085dc 100755 (executable)
@@ -135,8 +135,8 @@ if ($op eq 'add_form') {
         my $av = Koha::AuthorisedValue->new( {
             category => $new_category,
             authorised_value => $new_authorised_value,
-            lib => $input->param('lib') || undef,
-            lib_opac => $input->param('lib_opac') || undef,
+            lib => scalar $input->param('lib') || undef,
+            lib_opac => scalar $input->param('lib_opac') || undef,
             imageurl => $imageurl,
         } );
 
index 6031f2f..3626b67 100755 (executable)
@@ -101,7 +101,7 @@ if ( $op eq 'add_form' ) {
         $branchcode =~ s|\s||g;
         my $library = Koha::Library->new(
             {   branchcode => $branchcode,
-                ( map { $_ => $input->param($_) || undef } @fields )
+                ( map { $_ => scalar $input->param($_) || undef } @fields )
             }
         );
         eval { $library->store; };
@@ -180,7 +180,7 @@ if ( $op eq 'add_form' ) {
     } else {
         my $category = Koha::LibraryCategory->new(
             {   categorycode => $categorycode,
-                ( map { $_ => $input->param($_) || undef } @fields )
+                ( map { $_ => scalar $input->param($_) || undef } @fields )
             }
         );
         $category->show_in_pulldown( $input->param('show_in_pulldown') eq 'on' );
index e439a62..f160e6e 100755 (executable)
@@ -154,7 +154,7 @@ elsif ( $op eq 'add_validate' ) {
 
     if ( C4::Context->preference('EnhancedMessagingPreferences') ) {
         C4::Form::MessagingPreferences::handle_form_action( $input,
-            { categorycode => $input->param('categorycode') }, $template );
+            { categorycode => scalar $input->param('categorycode') }, $template );
     }
 
     $searchfield = q||;
index 261d94b..c99394b 100755 (executable)
@@ -105,7 +105,7 @@ sub add_attribute_type_form {
 sub error_add_attribute_type_form {
     my $template = shift;
 
-    $template->param(description => $input->param('description'));
+    $template->param(description => scalar $input->param('description'));
 
     if ($input->param('repeatable')) {
         $template->param(repeatable_checked => 1);
@@ -123,8 +123,8 @@ sub error_add_attribute_type_form {
         $template->param(display_checkout_checked => 'checked="checked"');
     }
 
-    $template->param( category_code => $input->param('category_code') );
-    $template->param( class => $input->param('class') );
+    $template->param( category_code => scalar $input->param('category_code') );
+    $template->param( class => scalar $input->param('class') );
 
     $template->param(
         attribute_type_form => 1,
index df4b99a..d1fe85b 100755 (executable)
@@ -115,5 +115,5 @@ sub ServerSearch  { #find server(s) by id or name
 
 sub _form_data_hashref {
     my ( $input, $fieldref ) = @_;
-    return { map { ( $_ => $input->param($_)//'' ) } @$fieldref };
+    return { map { ( $_ => scalar $input->param($_)//'' ) } @$fieldref };
 }
index 2966342..b484f03 100755 (executable)
@@ -93,13 +93,13 @@ if ( $op eq "do_search" ) {
     }
 
     push @field_data,
-      { term => "value_mainstr", val => $query->param('value_mainstr') || "" };
+      { term => "value_mainstr", val => scalar $query->param('value_mainstr') || "" };
     push @field_data,
-      { term => "value_main", val => $query->param('value_main') || "" };
+      { term => "value_main", val => scalar $query->param('value_main') || "" };
     push @field_data,
-      { term => "value_any", val => $query->param('value_any') || "" };
+      { term => "value_any", val => scalar $query->param('value_any') || "" };
     push @field_data,
-      { term => "value_match", val => $query->param('value_match') || "" };
+      { term => "value_match", val => scalar $query->param('value_match') || "" };
 
     my @numbers = ();
     if ( $total > $resultsperpage ) {
@@ -158,10 +158,10 @@ else {
 
 $template->param(
     op            => $op,
-    value_mainstr => $query->param('value_mainstr') || '',
-    value_main    => $query->param('value_main') || '',
-    value_any     => $query->param('value_any') || '',
-    value_match   => $query->param('value_match') || '',
+    value_mainstr => scalar $query->param('value_mainstr') || '',
+    value_main    => scalar $query->param('value_main') || '',
+    value_any     => scalar $query->param('value_any') || '',
+    value_match   => scalar $query->param('value_match') || '',
     tagid         => $tagid,
     index         => $index,
     authority_types  => $authority_types,
index 6aa2cee..37c739c 100755 (executable)
@@ -110,7 +110,7 @@ $template->param (
     z3950_search_params => C4::Search::z3950_search_args(GetBiblioData($biblionumber)),
     ocoins => GetCOinSBiblio($record),
     C4::Search::enabled_staff_search_views,
-    searchid            => $query->param('searchid'),
+    searchid            => scalar $query->param('searchid'),
 );
 
 my @allorders_using_biblio = GetOrdersByBiblionumber ($biblionumber);
index 0aff184..ccf178e 100755 (executable)
@@ -316,7 +316,7 @@ $template->param (
        marcview => 1,
        z3950_search_params             => C4::Search::z3950_search_args($biblio),
        C4::Search::enabled_staff_search_views,
-    searchid            => $query->param('searchid'),
+    searchid            => scalar $query->param('searchid'),
 );
 
 my @allorders_using_biblio = GetOrdersByBiblionumber ($biblionumber);
index 23d6d04..55fcab9 100755 (executable)
@@ -392,7 +392,7 @@ $template->param(
     subscriptions       => \@subs,
     subscriptionsnumber => $subscriptionsnumber,
     subscriptiontitle   => $dat->{title},
-    searchid            => $query->param('searchid'),
+    searchid            => scalar $query->param('searchid'),
 );
 
 # $debug and $template->param(debug_display => 1);
index dade645..2e6608b 100755 (executable)
@@ -189,10 +189,10 @@ if (scalar keys %params > 0) {
         $sortby = 'copyrightdate';
     }
     my $search_params = {
-        rows => $cgi->param('rows') // 20,
-        page => $cgi->param('page') || 1,
+        rows => scalar $cgi->param('rows') // 20,
+        page => scalar $cgi->param('page') || 1,
         sortby => $sortby,
-        sortorder => $cgi->param('sortorder') || 'asc',
+        sortorder => scalar $cgi->param('sortorder') || 'asc',
     };
 
     my ($results, $total_rows) = SearchItems($filter, $search_params);
index c5366e1..8ad2d22 100755 (executable)
@@ -114,7 +114,7 @@ $template->param (
        labeledmarcview => 1,
        z3950_search_params             => C4::Search::z3950_search_args($biblio),
        C4::Search::enabled_staff_search_views,
-    searchid            => $query->param('searchid'),
+    searchid            => scalar $query->param('searchid'),
 );
 
 my @allorders_using_biblio = GetOrdersByBiblionumber ($biblionumber);
index 57a0083..f0263ef 100755 (executable)
@@ -982,7 +982,7 @@ $template->param(
     frameworkcode => $frameworkcode,
     itemtype => $frameworkcode,
     borrowernumber => $loggedinuser,
-    tab => $input->param('tab')
+    tab => scalar $input->param('tab')
 );
 $template->{'VARS'}->{'searchid'} = $searchid;
 
index 72618e5..28fd247 100755 (executable)
@@ -919,7 +919,7 @@ $template->param(
     itemtagsubfield  => $itemtagsubfield,
     op      => $nextop,
     opisadd => ($nextop eq "saveitem") ? 0 : 1,
-    popup => $input->param('popup') ? 1: 0,
+    popup => scalar $input->param('popup') ? 1: 0,
     C4::Search::enabled_staff_search_views,
 );
 $template->{'VARS'}->{'searchid'} = $searchid;
index 54a937d..09517ed 100755 (executable)
@@ -178,7 +178,7 @@ if ($merge) {
         result => 1,
         report_records => \@report_records,
         report_header => $report_header,
-        ref_biblionumber => $input->param('ref_biblionumber')
+        ref_biblionumber => scalar $input->param('ref_biblionumber')
     );
 
 #-------------------------
index 72e9c15..601784c 100755 (executable)
@@ -24,6 +24,6 @@ use Koha::FrameworkPlugin;
 
 my $input = new CGI;
 my $plugin= Koha::FrameworkPlugin->new( {
-    name => $input->param("plugin_name"),
+    name => scalar $input->param("plugin_name"),
 });
 $plugin->launch({ cgi => $input });
index 28590a1..61204e9 100644 (file)
@@ -120,8 +120,8 @@ my $launcher= sub {
         flagsrequired => {editcatalogue => '*'},
     });
     $template->param(
-        index => $cgi->param('index'),
-        result => $cgi->param('result'),
+        index => scalar $cgi->param('index'),
+        result => scalar $cgi->param('result'),
     );
     output_html_with_http_headers $cgi, $cookie, $template->output;
 };
index 33b7420..448a609 100755 (executable)
@@ -147,7 +147,7 @@ my $launcher = sub {
         $subfield_value_z =~ s/'/\\'/g;
         $template->param(
             fillinput        => 1,
-            index            => $query->param('index') . "",
+            index            => scalar $query->param('index') . "",
             biblionumber     => $biblionumber ? $biblionumber : "",
             subfield_value_9 => "$subfield_value_9",
             subfield_value_0 => "$subfield_value_0",
@@ -285,7 +285,7 @@ my $launcher = sub {
         #           );
         $template->param(
             result         => \@arrayresults,
-            index          => $query->param('index') . "",
+            index          => scalar $query->param('index') . "",
             startfrom      => $startfrom,
             displaynext    => $displaynext,
             displayprev    => $displayprev,
@@ -316,7 +316,7 @@ my $launcher = sub {
 
         $template->param(
             itypeloop => \@itemtypes,
-            index     => $query->param('index'),
+            index     => scalar $query->param('index'),
             Search    => 1,
         );
     }
index 186d464..fe9f19a 100755 (executable)
@@ -136,7 +136,7 @@ my ($input) = @_;
         my $link="../cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_210c.pl&amp;authtypecode=EDITORS&amp;".join("&amp;",map {"value=".$_} @value)."&amp;op=do_search&amp;type=intranet&amp;index=$index";
 
         $template->param(result => $results) if $results;
-        $template->param('index' => $query->param('index'));
+        $template->param('index' => scalar $query->param('index'));
         $template->param(startfrom=> $startfrom,
                                 displaynext=> $displaynext,
                                 displayprev=> $displayprev,
index be299eb..a5f2103 100755 (executable)
@@ -332,7 +332,7 @@ sub plugin {
         $subfield_value_y =~ s/'/\\'/g;
         $template->param(
             fillinput        => 1,
-            index            => $query->param('index') . "",
+            index            => scalar $query->param('index') . "",
             biblionumber     => $biblionumber ? $biblionumber : "",
             subfield_value_9 => "$subfield_value_9",
             subfield_value_0 => "$subfield_value_0",
@@ -487,7 +487,7 @@ sub plugin {
 #           );
         $template->param(
             result         => \@arrayresults,
-            index          => $query->param('index') . "",
+            index          => scalar $query->param('index') . "",
             startfrom      => $startfrom,
             displaynext    => $displaynext,
             displayprev    => $displayprev,
@@ -521,7 +521,7 @@ sub plugin {
 
         $template->param(    #classlist => $classlist,
             itypeloop    => \@itemtypes,
-            index        => $query->param('index'),
+            index        => scalar $query->param('index'),
             Search       => 1,
         );
     }
index 960b5aa..c808b7b 100755 (executable)
@@ -86,7 +86,7 @@ if ( @id==0 ) {
 }
 
 my $pars= {
-        random => $input->param('random') || rand(1000000000),
+        random => scalar $input->param('random') || rand(1000000000),
         page => $page,
         id => \@id,
         nameany => $nameany,
index cc70776..52cd2eb 100755 (executable)
@@ -624,7 +624,7 @@ $template->param(
     branchname        => GetBranchName($borrower->{'branchcode'}),
     printer           => $printer,
     printername       => $printer,
-    was_renewed       => $query->param('was_renewed') ? 1 : 0,
+    was_renewed       => scalar $query->param('was_renewed') ? 1 : 0,
     expiry            => $borrower->{'dateexpiry'},
     roadtype          => $roadtype,
     amountold         => $amountold,
index 2f09b80..7442206 100755 (executable)
@@ -75,8 +75,8 @@ if ($session->param('branch') eq 'NO_LIBRARY_SET'){
 if ( $query->param('print_slip') ) {
     $template->param(
         print_slip     => 1,
-        borrowernumber => $query->param('borrowernumber'),
-        biblionumber   => $query->param('biblionumber'),
+        borrowernumber => scalar $query->param('borrowernumber'),
+        biblionumber   => scalar $query->param('biblionumber'),
     );
 }
 
index 7c0c6d7..36fd9a5 100755 (executable)
@@ -119,7 +119,7 @@ foreach ($query->param()) {
     $_ eq "oldreferer" and next;  # disclude oldreferer
     push @recycle_loop, {
         param => $_,
-        value => $query->param($_),
+        value => scalar $query->param($_),
     };
 }
 
index 0c4a772..24ea732 100755 (executable)
@@ -79,18 +79,18 @@ if ( $action eq 'lookup' ) {
 
 } elsif ( $action eq 'add' ) {
     my $ci_id = ModCourseItem(
-        itemnumber    => $cgi->param('itemnumber'),
-        itype         => $cgi->param('itype'),
-        ccode         => $cgi->param('ccode'),
-        holdingbranch => $cgi->param('holdingbranch'),
-        location      => $cgi->param('location'),
+        itemnumber    => scalar $cgi->param('itemnumber'),
+        itype         => scalar $cgi->param('itype'),
+        ccode         => scalar $cgi->param('ccode'),
+        holdingbranch => scalar $cgi->param('holdingbranch'),
+        location      => scalar $cgi->param('location'),
     );
 
     my $cr_id = ModCourseReserve(
         course_id   => $course_id,
         ci_id       => $ci_id,
-        staff_note  => $cgi->param('staff_note'),
-        public_note => $cgi->param('public_note'),
+        staff_note  => scalar $cgi->param('staff_note'),
+        public_note => scalar $cgi->param('public_note'),
     );
 
     if ( $return ) {
index 845239d..af1eb62 100755 (executable)
@@ -47,7 +47,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
 );
 
 if ( $action eq 'del_reserve' ) {
-    DelCourseReserve( cr_id => $cgi->param('cr_id') );
+    DelCourseReserve( cr_id => scalar $cgi->param('cr_id') );
 }
 
 my $course          = GetCourse($course_id);
index f84a01d..c1aafd4 100755 (executable)
@@ -103,16 +103,16 @@ elsif  ($op eq 'save') {
         $cgi->param('format_string', $format_string);
     }
     my @params = (
-                    barcode_type    => $cgi->param('barcode_type') || 'CODE39',
-                    printing_type   => $cgi->param('printing_type') || 'BAR',
-                    layout_name     => $cgi->param('layout_name') || 'DEFAULT',
+                    barcode_type    => scalar $cgi->param('barcode_type') || 'CODE39',
+                    printing_type   => scalar $cgi->param('printing_type') || 'BAR',
+                    layout_name     => scalar $cgi->param('layout_name') || 'DEFAULT',
                     guidebox        => ($cgi->param('guidebox') ? 1 : 0),
                     oblique_title   => ($cgi->param('oblique_title') ? 1 : 0),
-                    font            => $cgi->param('font') || 'TR',
-                    font_size       => $cgi->param('font_size') || 3,
+                    font            => scalar $cgi->param('font') || 'TR',
+                    font_size       => scalar $cgi->param('font_size') || 3,
                     callnum_split   => ($cgi->param('callnum_split') ? 1 : 0),
-                    text_justify    => $cgi->param('text_justify') || 'L',
-                    format_string   => $cgi->param('format_string') || 'title, author, isbn, issn, itemtype, barcode, itemcallnumber',
+                    text_justify    => scalar $cgi->param('text_justify') || 'L',
+                    format_string   => scalar $cgi->param('format_string') || 'title, author, isbn, issn, itemtype, barcode, itemcallnumber',
     );
     if ($layout_id) {   # if a label_id was passed in, this is an update to an existing layout
         $layout = C4::Labels::Layout->retrieve(layout_id => $layout_id);
index eb8c206..7e87370 100755 (executable)
@@ -54,13 +54,13 @@ if ($op eq 'edit') {
 }
 elsif ($op eq 'save') {
     my @params = (
-        printer_name        => $cgi->param('printer_name') || 'DEFAULT PRINTER',
-        paper_bin           => $cgi->param('paper_bin') || 'Tray 1',
-        offset_horz         => $cgi->param('offset_horz') || 0,
-        offset_vert         => $cgi->param('offset_vert') || 0,
-        creep_horz          => $cgi->param('creep_horz') || 0,
-        creep_vert          => $cgi->param('creep_vert') || 0,
-        units               => $cgi->param('units') || 'POINT',
+        printer_name        => scalar $cgi->param('printer_name') || 'DEFAULT PRINTER',
+        paper_bin           => scalar $cgi->param('paper_bin') || 'Tray 1',
+        offset_horz         => scalar $cgi->param('offset_horz') || 0,
+        offset_vert         => scalar $cgi->param('offset_vert') || 0,
+        creep_horz          => scalar $cgi->param('creep_horz') || 0,
+        creep_vert          => scalar $cgi->param('creep_vert') || 0,
+        units               => scalar $cgi->param('units') || 'POINT',
     );
     if ($profile_id) {   # if a label_id was passed in, this is an update to an existing layout
         $profile = C4::Labels::Profile->retrieve(profile_id => $profile_id);
index 4e1e002..c06a9f1 100755 (executable)
@@ -61,22 +61,22 @@ if ($op eq 'edit') {
     }
 }
 elsif ($op eq 'save') {
-    my @params = (      profile_id      => $cgi->param('profile_id'),
-                        template_code   => $cgi->param('template_code') || 'DEFAULT_TEMPLATE',
-                        template_desc   => $cgi->param('template_desc') || 'Default description',
-                        page_width      => $cgi->param('page_width') || 0,
-                        page_height     => $cgi->param('page_height') || 0,
-                        label_width     => $cgi->param('label_width') || 0,
-                        label_height    => $cgi->param('label_height') || 0,
-                        top_text_margin => $cgi->param('top_text_margin') || 0,
-                        left_text_margin=> $cgi->param('left_text_margin') || 0,
-                        top_margin      => $cgi->param('top_margin') || 0,
-                        left_margin     => $cgi->param('left_margin') || 0,
-                        cols            => $cgi->param('cols') || 0,
-                        rows            => $cgi->param('rows') || 0,
-                        col_gap         => $cgi->param('col_gap') || 0,
-                        row_gap         => $cgi->param('row_gap') || 0,
-                        units           => $cgi->param('units') || 'POINT',
+    my @params = (      profile_id      => scalar $cgi->param('profile_id'),
+                        template_code   => scalar $cgi->param('template_code') || 'DEFAULT_TEMPLATE',
+                        template_desc   => scalar $cgi->param('template_desc') || 'Default description',
+                        page_width      => scalar $cgi->param('page_width') || 0,
+                        page_height     => scalar $cgi->param('page_height') || 0,
+                        label_width     => scalar $cgi->param('label_width') || 0,
+                        label_height    => scalar $cgi->param('label_height') || 0,
+                        top_text_margin => scalar $cgi->param('top_text_margin') || 0,
+                        left_text_margin=> scalar $cgi->param('left_text_margin') || 0,
+                        top_margin      => scalar $cgi->param('top_margin') || 0,
+                        left_margin     => scalar $cgi->param('left_margin') || 0,
+                        cols            => scalar $cgi->param('cols') || 0,
+                        rows            => scalar $cgi->param('rows') || 0,
+                        col_gap         => scalar $cgi->param('col_gap') || 0,
+                        row_gap         => scalar $cgi->param('row_gap') || 0,
+                        units           => scalar $cgi->param('units') || 'POINT',
                         );
     if ($template_id) {   # if a template_id was passed in, this is an update to an existing template
         $label_template = C4::Labels::Template->retrieve(template_id => $template_id);
@@ -87,7 +87,7 @@ elsif ($op eq 'save') {
                 $old_profile->set_attr(template_id => 0);
                 $old_profile->save();
             }
-            my $new_profile = C4::Labels::Profile->retrieve(profile_id => $cgi->param('profile_id'));
+            my $new_profile = C4::Labels::Profile->retrieve(profile_id => scalar $cgi->param('profile_id'));
             $new_profile->set_attr(template_id => $label_template->get_attr('template_id'));
             $new_profile->save();
         }
@@ -106,7 +106,7 @@ elsif ($op eq 'save') {
         $label_template = C4::Labels::Template->new(@params);
         my $template_id = $label_template->save();
         if ($cgi->param('profile_id')) {
-            my $profile = C4::Labels::Profile->retrieve(profile_id => $cgi->param('profile_id'));
+            my $profile = C4::Labels::Profile->retrieve(profile_id => scalar $cgi->param('profile_id'));
             $profile->set_attr(template_id => $template_id) if $template_id != $profile->get_attr('template_id');
             $profile->save();
         }
index 73a486a..3aa6aa7 100755 (executable)
@@ -91,7 +91,7 @@ else {
                     name    => $filename,
                     type    => $mimetype,
                     content => $file_content,
-                    description => $cgi->param('description'),
+                    description => scalar $cgi->param('description'),
                 );
             }
         }
@@ -99,7 +99,7 @@ else {
             $errors{'no_file'} = 1;
         }
     } elsif ( $op eq 'delete' ) {
-        $bf->DelFile( id => $cgi->param('file_id') );
+        $bf->DelFile( id => scalar $cgi->param('file_id') );
     }
 
     $template->param(
index 0d18687..810a988 100755 (executable)
@@ -77,9 +77,9 @@ my $view = $input->request_method() eq "GET" ? "show_form" : "show_results";
 $template->param(
     patron_lists => [ GetPatronLists() ],
     searchmember        => $searchmember,
-    branchcode_filter   => $input->param('branchcode_filter'),
-    categorycode_filter => $input->param('categorycode_filter'),
-    searchtype          => $input->param('searchtype') || 'contain',
+    branchcode_filter   => scalar $input->param('branchcode_filter'),
+    categorycode_filter => scalar $input->param('categorycode_filter'),
+    searchtype          => scalar $input->param('searchtype') || 'contain',
     searchfieldstype    => $searchfieldstype,
     PatronsPerPage      => C4::Context->preference("PatronsPerPage") || 20,
     view                => $view,
index c211a4a..30b5beb 100755 (executable)
@@ -119,7 +119,7 @@ if ( $input->param('add_debarment') ) {
         {
             borrowernumber => $borrowernumber,
             type           => 'MANUAL',
-            comment        => $input->param('debarred_comment'),
+            comment        => scalar $input->param('debarred_comment'),
             expiration     => $expiration,
         }
     );
index 444114e..5724b2b 100755 (executable)
@@ -44,7 +44,7 @@ if ( $action eq 'del' ) {
     AddDebarment(
         {   borrowernumber => $borrowernumber,
             type           => 'MANUAL',
-            comment        => $cgi->param('comment'),
+            comment        => scalar $cgi->param('comment'),
             expiration     => $expiration,
         }
     );
index 7c962a4..80814c3 100755 (executable)
@@ -324,7 +324,7 @@ $template->param(
     borrowernumber  => $borrowernumber,
     othernames      => $data->{'othernames'},
     categoryname    => $data->{'description'},
-    was_renewed     => $input->param('was_renewed') ? 1 : 0,
+    was_renewed     => scalar $input->param('was_renewed') ? 1 : 0,
     branch          => $branch,
     todaysdate      => output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }),
     totalprice      => sprintf("%.2f", $totalprice),
index dc6e585..1d6126b 100755 (executable)
@@ -111,35 +111,35 @@ if ( $op && $op eq 'search' ) {
     my %borrower = (
         'surname'      => NLGetSurname( $cgi->param('navn') ),
         'firstname'    => NLGetFirstname( $cgi->param('navn') ),
-        'sex'          => $cgi->param('kjonn'),
-        'dateofbirth'  => $cgi->param('fdato'),
-        'cardnumber'   => $cgi->param('lnr'),
-        'userid'       => $cgi->param('lnr'),
-        'address'      => $cgi->param('p_adresse1'),
-        'address2'     => $cgi->param('p_adresse2'),
-        'zipcode'      => $cgi->param('p_postnr'),
-        'city'         => $cgi->param('p_sted'),
-        'country'      => $cgi->param('p_land'),
-        'B_address'    => $cgi->param('m_adresse1'),
-        'B_address2'   => $cgi->param('m_adresse2'),
-        'B_zipcode'    => $cgi->param('m_postnr'),
-        'B_city'       => $cgi->param('m_sted'),
-        'B_country'    => $cgi->param('m_land'),
+        'sex'          => scalar $cgi->param('kjonn'),
+        'dateofbirth'  => scalar $cgi->param('fdato'),
+        'cardnumber'   => scalar $cgi->param('lnr'),
+        'userid'       => scalar $cgi->param('lnr'),
+        'address'      => scalar $cgi->param('p_adresse1'),
+        'address2'     => scalar $cgi->param('p_adresse2'),
+        'zipcode'      => scalar $cgi->param('p_postnr'),
+        'city'         => scalar $cgi->param('p_sted'),
+        'country'      => scalar $cgi->param('p_land'),
+        'B_address'    => scalar $cgi->param('m_adresse1'),
+        'B_address2'   => scalar $cgi->param('m_adresse2'),
+        'B_zipcode'    => scalar $cgi->param('m_postnr'),
+        'B_city'       => scalar $cgi->param('m_sted'),
+        'B_country'    => scalar $cgi->param('m_land'),
         'password'     => NLDecodePin( $cgi->param('pin') ),
-        'dateexpiry'   => $cgi->param('gyldig_til'),
-        'email'        => $cgi->param('epost'),
-        'mobile'       => $cgi->param('tlf_mobil'),
-        'phone'        => $cgi->param('tlf_hjemme'),
-        'phonepro'     => $cgi->param('tlf_jobb'),
+        'dateexpiry'   => scalar $cgi->param('gyldig_til'),
+        'email'        => scalar $cgi->param('epost'),
+        'mobile'       => scalar $cgi->param('tlf_mobil'),
+        'phone'        => scalar $cgi->param('tlf_hjemme'),
+        'phonepro'     => scalar $cgi->param('tlf_jobb'),
         'branchcode'   => $userenv->{'branch'},
-        'categorycode' => $cgi->param('categorycode'),
+        'categorycode' => scalar $cgi->param('categorycode'),
     );
     # Add the new patron
     my $borrowernumber = &AddMember(%borrower);
     if ( $borrowernumber ) {
         # Add extended patron attributes
         SetBorrowerAttributes($borrowernumber, [
-            { code => 'fnr', value => $cgi->param('fnr_hash') },
+            { code => 'fnr', value => scalar $cgi->param('fnr_hash') },
         ], 'no_branch_limit' );
         # Override the default sync data created by AddMember
         my $borrowersync = Koha::Database->new->schema->resultset('BorrowerSync')->find({
index e9de655..c68d205 100755 (executable)
@@ -96,7 +96,7 @@ if ( $individual || $writeoff ) {
     $template->param(
         selected_accts => $select_lines,
         amt            => $total_due,
-        selected_accts_notes => $input->param('notes'),
+        selected_accts_notes => scalar $input->param('notes'),
     );
 }
 
index 7512f2e..e02e5f3 100755 (executable)
@@ -67,10 +67,10 @@ $template->param(
     ACCOUNT_LINES => $accts,
     total         => sprintf( "%.2f", $total ),
     accountview   => 1,
-    message       => $query->param('message') || q{},
-    message_value => $query->param('message_value') || q{},
-    payment       => $query->param('payment') || q{},
-    payment_error => $query->param('payment-error') || q{},
+    message       => scalar $query->param('message') || q{},
+    message_value => scalar $query->param('message_value') || q{},
+    payment       => scalar $query->param('payment') || q{},
+    payment_error => scalar $query->param('payment-error') || q{},
 );
 
 output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
index 0d5d924..43705e3 100755 (executable)
@@ -74,7 +74,7 @@ $template->param(
     'biblionumber'   => $biblionumber,
     'borrowernumber' => $borrowernumber,
     'review'         => $clean || $savedreview->{'review'},
-       'reviewid'       => $query->param('reviewid') || 0,
+       'reviewid'       => scalar $query->param('reviewid') || 0,
     'title'          => $biblio->{'title'},
 );
 
index 4e0a68f..abd7847 100755 (executable)
@@ -374,7 +374,7 @@ if ( $template_type && $template_type eq 'advsearch' ) {
     # but let the user override it
     if (defined $cgi->param('expanded_options')) {
         if ( ($cgi->param('expanded_options') == 0) || ($cgi->param('expanded_options') == 1 ) ) {
-            $template->param( expanded_options => $cgi->param('expanded_options'));
+            $template->param( expanded_options => scalar $cgi->param('expanded_options'));
         }
     }
 
index fad6127..11928bd 100755 (executable)
@@ -78,7 +78,7 @@ if ( $selectview eq "full" ) {
     # $subscription->{opacnote} =~ s/\n/\<br\/\>/g;
 
     $template->param(
-        biblionumber   => $query->param('biblionumber'),
+        biblionumber   => scalar $query->param('biblionumber'),
         years          => $subscriptioninformation,
         yearmin        => $yearmin,
         yearmax        => $yearmax,
@@ -114,7 +114,7 @@ else {
     # $subscription->{opacnote} =~ s/\n/\<br\/\>/g;
 
     $template->param(
-        biblionumber      => $query->param('biblionumber'),
+        biblionumber      => scalar $query->param('biblionumber'),
         subscription_LOOP => $subscriptions,
     );
 }
index 4a25a79..9c0ebe8 100755 (executable)
@@ -355,7 +355,7 @@ $template->param(
     shelf    => $shelf,
     messages => \@messages,
     category => $category,
-    print    => $query->param('print') || 0,
+    print    => scalar $query->param('print') || 0,
     listsview => 1,
 );
 
index ac240df..1bb4d2d 100755 (executable)
@@ -88,7 +88,7 @@ foreach my $type (@advanced_search_types) {
         $type = 'itemtype';
     }
     $params->{$type} = $input->param($type);
-    $template->param('selected_' . $type => $input->param($type));
+    $template->param('selected_' . $type => scalar $input->param($type));
 }
 
 my @results = GetTopIssues($params);
index 0828739..413c26d 100755 (executable)
@@ -353,7 +353,7 @@ $template->param(
     SuspendHoldsOpac         => C4::Context->preference('SuspendHoldsOpac'),
     AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds'),
     OpacHoldNotes            => C4::Context->preference('OpacHoldNotes'),
-    failed_holds             => $query->param('failed_holds'),
+    failed_holds             => scalar $query->param('failed_holds'),
 );
 
 output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
index 596a2c1..9a21681 100755 (executable)
@@ -38,7 +38,7 @@ my ( $template, $logged_in_user, $cookie ) = get_template_and_user(
 );
 
 my ($list) =
-  GetPatronLists( { patron_list_id => $cgi->param('patron_list_id') } );
+  GetPatronLists( { patron_list_id => scalar $cgi->param('patron_list_id') } );
 
 my @patrons_to_add = $cgi->multi_param('patrons_to_add');
 if (@patrons_to_add) {
index 415cd8c..55e903c 100755 (executable)
@@ -54,13 +54,13 @@ if ($op eq 'edit') {
 }
 elsif ($op eq 'save') {
     my @params = (
-        printer_name        => $cgi->param('printer_name'),
-        paper_bin           => $cgi->param('paper_bin'),
-        offset_horz         => $cgi->param('offset_horz'),
-        offset_vert         => $cgi->param('offset_vert'),
-        creep_horz          => $cgi->param('creep_horz'),
-        creep_vert          => $cgi->param('creep_vert'),
-        units               => $cgi->param('units'),
+        printer_name        => scalar $cgi->param('printer_name'),
+        paper_bin           => scalar $cgi->param('paper_bin'),
+        offset_horz         => scalar $cgi->param('offset_horz'),
+        offset_vert         => scalar $cgi->param('offset_vert'),
+        creep_horz          => scalar $cgi->param('creep_horz'),
+        creep_vert          => scalar $cgi->param('creep_vert'),
+        units               => scalar $cgi->param('units'),
     );
     if ($profile_id) {   # if a label_id was passed in, this is an update to an existing layout
         $profile = C4::Patroncards::Profile->retrieve(profile_id => $profile_id);
index 763fe45..c7b4708 100755 (executable)
@@ -53,20 +53,20 @@ if ($op eq 'edit') {
     $profile_list = get_all_profiles(field_list => 'profile_id,printer_name,paper_bin', filter => "template_id=$template_id OR template_id=''");
 }
 elsif ($op eq 'save') {
-    my @params = (      profile_id      => $cgi->param('profile_id') || '',
-                        template_code   => $cgi->param('template_code'),
-                        template_desc   => $cgi->param('template_desc'),
-                        page_width      => $cgi->param('page_width'),
-                        page_height     => $cgi->param('page_height'),
-                        label_width     => $cgi->param('card_width'),
-                        label_height    => $cgi->param('card_height'),
-                        top_margin      => $cgi->param('top_margin'),
-                        left_margin     => $cgi->param('left_margin'),
-                        cols            => $cgi->param('cols'),
-                        rows            => $cgi->param('rows'),
-                        col_gap         => $cgi->param('col_gap'),
-                        row_gap         => $cgi->param('row_gap'),
-                        units           => $cgi->param('units'),
+    my @params = (      profile_id      => scalar $cgi->param('profile_id') || '',
+                        template_code   => scalar $cgi->param('template_code'),
+                        template_desc   => scalar $cgi->param('template_desc'),
+                        page_width      => scalar $cgi->param('page_width'),
+                        page_height     => scalar $cgi->param('page_height'),
+                        label_width     => scalar $cgi->param('card_width'),
+                        label_height    => scalar $cgi->param('card_height'),
+                        top_margin      => scalar $cgi->param('top_margin'),
+                        left_margin     => scalar $cgi->param('left_margin'),
+                        cols            => scalar $cgi->param('cols'),
+                        rows            => scalar $cgi->param('rows'),
+                        col_gap         => scalar $cgi->param('col_gap'),
+                        row_gap         => scalar $cgi->param('row_gap'),
+                        units           => scalar $cgi->param('units'),
                         );
     if ($template_id) {   # if a template_id was passed in, this is an update to an existing template
         $card_template = C4::Patroncards::Template->retrieve(template_id => $template_id);
@@ -76,7 +76,7 @@ elsif ($op eq 'save') {
                 $old_profile->set_attr(template_id => 0);
                 $old_profile->save();
             }
-            my $new_profile = C4::Patroncards::Profile->retrieve(profile_id => $cgi->param('profile_id'));
+            my $new_profile = C4::Patroncards::Profile->retrieve(profile_id => scalar $cgi->param('profile_id'));
             $new_profile->set_attr(template_id => $card_template->get_attr('template_id'));
             $new_profile->save();
         }
@@ -88,7 +88,7 @@ elsif ($op eq 'save') {
         die "Error: $card_template\n" if !ref($card_template);
         my $template_id = $card_template->save();
         if ($cgi->param('profile_id')) {
-            my $profile = C4::Patroncards::Profile->retrieve(profile_id => $cgi->param('profile_id'));
+            my $profile = C4::Patroncards::Profile->retrieve(profile_id => scalar $cgi->param('profile_id'));
             $profile->set_attr(template_id => $template_id) if $template_id != $profile->get_attr('template_id');
             $profile->save();
         }
index 7af02bc..75040f4 100755 (executable)
@@ -286,16 +286,16 @@ elsif ( $phase eq 'Report on this Area' ) {
         'areas'   => get_report_areas(),
         'cache_expiry' => $cache_expiry,
         'usecache' => $usecache,
-        'public' => $input->param('public'),
+        'public' => scalar $input->param('public'),
       );
     } else {
       # they have choosen a new report and the area to report on
       $template->param(
           'build2' => 1,
-          'area'   => $input->param('area'),
+          'area'   => scalar $input->param('area'),
           'types'  => get_report_types(),
           'cache_expiry' => $cache_expiry,
-          'public' => $input->param('public'),
+          'public' => scalar $input->param('public'),
       );
     }
 }
@@ -310,8 +310,8 @@ elsif ( $phase eq 'Choose this type' ) {
         'area'   => $area,
         'type'   => $type,
         columns  => get_columns($area,$input),
-        'cache_expiry' => $input->param('cache_expiry'),
-        'public' => $input->param('public'),
+        'cache_expiry' => scalar $input->param('cache_expiry'),
+        'public' => scalar $input->param('public'),
     );
 }
 
@@ -330,12 +330,12 @@ elsif ( $phase eq 'Choose these columns' ) {
         'column' => $column,
         definitions => get_from_dictionary($area),
         criteria    => get_criteria($area,$input),
-        'public' => $input->param('public'),
+        'public' => scalar $input->param('public'),
     );
     if ( $usecache ) {
         $template->param(
-            cache_expiry => $input->param('cache_expiry'),
-            cache_expiry_units => $input->param('cache_expiry_units'),
+            cache_expiry => scalar $input->param('cache_expiry'),
+            cache_expiry_units => scalar $input->param('cache_expiry_units'),
         );
     }
 
@@ -395,12 +395,12 @@ elsif ( $phase eq 'Choose these criteria' ) {
         'column'         => $column,
         'definition'     => $definition,
         'criteriastring' => $query_criteria,
-        'public' => $input->param('public'),
+        'public' => scalar $input->param('public'),
     );
     if ( $usecache ) {
         $template->param(
-            cache_expiry => $input->param('cache_expiry'),
-            cache_expiry_units => $input->param('cache_expiry_units'),
+            cache_expiry => scalar $input->param('cache_expiry'),
+            cache_expiry_units => scalar $input->param('cache_expiry_units'),
         );
     }
 
@@ -442,8 +442,8 @@ elsif ( $phase eq 'Choose these operations' ) {
         'criteriastring' => $criteria,
         'totals'         => $totals,
         'definition'     => $definition,
-        'cache_expiry' => $input->param('cache_expiry'),
-        'public' => $input->param('public'),
+        'cache_expiry' => scalar $input->param('cache_expiry'),
+        'public' => scalar $input->param('public'),
     );
 
     # get columns
@@ -495,8 +495,8 @@ elsif ( $phase eq 'Build report' ) {
         'area'       => $area,
         'sql'        => $sql,
         'type'       => $type,
-        'cache_expiry' => $input->param('cache_expiry'),
-        'public' => $input->param('public'),
+        'cache_expiry' => scalar $input->param('cache_expiry'),
+        'public' => scalar $input->param('public'),
     );
 }
 
@@ -510,8 +510,8 @@ elsif ( $phase eq 'Save' ) {
         'area'  => $area,
         'sql'  => $sql,
         'type' => $type,
-        'cache_expiry' => $input->param('cache_expiry'),
-        'public' => $input->param('public'),
+        'cache_expiry' => scalar $input->param('cache_expiry'),
+        'public' => scalar $input->param('public'),
         'groups_with_subgroups' => groups_with_subgroups($area), # in case we have a report group that matches area
     );
 }
@@ -912,9 +912,9 @@ elsif ( $phase eq 'Create report from SQL' ) {
         $group = $input->param('report_group');
         $subgroup  = $input->param('report_subgroup');
         $template->param(
-            'sql'           => $input->param('sql') // '',
-            'reportname'    => $input->param('reportname') // '',
-            'notes'         => $input->param('notes') // '',
+            'sql'           => scalar $input->param('sql') // '',
+            'reportname'    => scalar $input->param('reportname') // '',
+            'notes'         => scalar $input->param('notes') // '',
         );
     }
     $template->param(
index c5bfbca..fdda1fd 100755 (executable)
@@ -76,7 +76,7 @@ if ($selectview eq "full"){
  # $subscription->{opacnote} =~ s/\n/\<br\/\>/g;
 
     $template->param(
-        biblionumber => $query->param('biblionumber'),
+        biblionumber => scalar $query->param('biblionumber'),
         years => $subscriptions,
         yearmin => $yearmin,
         yearmax =>$yearmax,
index f51fabb..47d07eb 100755 (executable)
@@ -160,7 +160,7 @@ $template->param(
           suggestion => C4::Context->preference("suggestion"),
           virtualshelves => C4::Context->preference("virtualshelves"),
           routing => C4::Context->preference("RoutingSerials"),
-          subscr=>$query->param('subscriptionid'),
+          subscr=>scalar $query->param('subscriptionid'),
           subscriptioncount => $subscriptioncount,
           location => $location,
           callnumber          => $callnumber,
index add9f06..6986b5e 100755 (executable)
@@ -59,22 +59,22 @@ my $custompattern = $input->param('custompattern');
 my $frequency = GetSubscriptionFrequency($frequencyid);
 
 my %pattern = (
-    numberingmethod => $input->param('numberingmethod') // '',
-    numbering1      => $input->param('numbering1') // '',
-    numbering2      => $input->param('numbering2') // '',
-    numbering3      => $input->param('numbering3') // '',
-    add1            => $input->param('add1') // '',
-    add2            => $input->param('add2') // '',
-    add3            => $input->param('add3') // '',
-    whenmorethan1   => $input->param('whenmorethan1') // '',
-    whenmorethan2   => $input->param('whenmorethan2') // '',
-    whenmorethan3   => $input->param('whenmorethan3') // '',
-    setto1          => $input->param('setto1') // '',
-    setto2          => $input->param('setto2') // '',
-    setto3          => $input->param('setto3') // '',
-    every1          => $input->param('every1') // '',
-    every2          => $input->param('every2') // '',
-    every3          => $input->param('every3') // '',
+    numberingmethod => scalar $input->param('numberingmethod') // '',
+    numbering1      => scalar $input->param('numbering1') // '',
+    numbering2      => scalar $input->param('numbering2') // '',
+    numbering3      => scalar $input->param('numbering3') // '',
+    add1            => scalar $input->param('add1') // '',
+    add2            => scalar $input->param('add2') // '',
+    add3            => scalar $input->param('add3') // '',
+    whenmorethan1   => scalar $input->param('whenmorethan1') // '',
+    whenmorethan2   => scalar $input->param('whenmorethan2') // '',
+    whenmorethan3   => scalar $input->param('whenmorethan3') // '',
+    setto1          => scalar $input->param('setto1') // '',
+    setto2          => scalar $input->param('setto2') // '',
+    setto3          => scalar $input->param('setto3') // '',
+    every1          => scalar $input->param('every1') // '',
+    every2          => scalar $input->param('every2') // '',
+    every3          => scalar $input->param('every3') // '',
 );
 
 $firstacquidate = eval { output_pref( { str => $firstacquidate, dateonly => 1, dateformat => 'iso' } ); }
@@ -90,13 +90,13 @@ if($nextacquidate) {
 my $date = $nextacquidate;
 
 my %subscription = (
-    locale      => $input->param('locale') // '',
-    lastvalue1      => $input->param('lastvalue1') // '',
-    lastvalue2      => $input->param('lastvalue2') // '',
-    lastvalue3      => $input->param('lastvalue3') // '',
-    innerloop1      => $input->param('innerloop1') // '',
-    innerloop2      => $input->param('innerloop2') // '',
-    innerloop3      => $input->param('innerloop3') // '',
+    locale      => scalar $input->param('locale') // '',
+    lastvalue1      => scalar $input->param('lastvalue1') // '',
+    lastvalue2      => scalar $input->param('lastvalue2') // '',
+    lastvalue3      => scalar $input->param('lastvalue3') // '',
+    innerloop1      => scalar $input->param('innerloop1') // '',
+    innerloop2      => scalar $input->param('innerloop2') // '',
+    innerloop3      => scalar $input->param('innerloop3') // '',
     irregularity    => '',
     periodicity     => $frequencyid,
     countissuesperunit  => 1,
index 1d9ab37..31a6b6b 100755 (executable)
@@ -323,9 +323,9 @@ sub redirect_add_subscription {
     my $location          = $query->param('location');
     my $skip_serialseq    = $query->param('skip_serialseq');
 
-    my $startdate      = output_pref( { str => $query->param('startdate'),      dateonly => 1, dateformat => 'iso' } );
-    my $enddate        = output_pref( { str => $query->param('enddate'),        dateonly => 1, dateformat => 'iso' } );
-    my $firstacquidate = output_pref( { str => $query->param('firstacquidate'), dateonly => 1, dateformat => 'iso' } );
+    my $startdate      = output_pref( { str => scalar $query->param('startdate'),      dateonly => 1, dateformat => 'iso' } );
+    my $enddate        = output_pref( { str => scalar $query->param('enddate'),        dateonly => 1, dateformat => 'iso' } );
+    my $firstacquidate = output_pref( { str => scalar $query->param('firstacquidate'), dateonly => 1, dateformat => 'iso' } );
 
     if(!defined $enddate || $enddate eq '') {
         if($subtype eq "issues") {
@@ -357,16 +357,16 @@ sub redirect_mod_subscription {
     my $subscriptionid = $query->param('subscriptionid');
     my @irregularity = $query->multi_param('irregularity');
     my $auser = $query->param('user');
-    my $librarian => $query->param('librarian'),
+    my $librarian => scalar $query->param('librarian'),
     my $branchcode = $query->param('branchcode');
     my $cost = $query->param('cost');
     my $aqbooksellerid = $query->param('aqbooksellerid');
     my $biblionumber = $query->param('biblionumber');
     my $aqbudgetid = $query->param('aqbudgetid');
 
-    my $startdate      = output_pref( { str => $query->param('startdate'),      dateonly => 1, dateformat => 'iso' } );
-    my $enddate        = output_pref( { str => $query->param('enddate'),        dateonly => 1, dateformat => 'iso' } );
-    my $firstacquidate = output_pref( { str => $query->param('firstacquidate'), dateonly => 1, dateformat => 'iso' } );
+    my $startdate      = output_pref( { str => scalar $query->param('startdate'),      dateonly => 1, dateformat => 'iso' } );
+    my $enddate        = output_pref( { str => scalar $query->param('enddate'),        dateonly => 1, dateformat => 'iso' } );
+    my $firstacquidate = output_pref( { str => scalar $query->param('firstacquidate'), dateonly => 1, dateformat => 'iso' } );
 
     my $nextacquidate  = $query->param('nextacquidate');
     $nextacquidate = $nextacquidate
@@ -451,7 +451,7 @@ sub insert_additional_fields {
             }
         } else {
             $af->{values} = {
-                $subscriptionid => $query->param('additional_field_' . $field->{id})
+                $subscriptionid => scalar $query->param('additional_field_' . $field->{id})
             } if defined $query->param('additional_field_' . $field->{id});
         }
         $af->insert_values;
index 226a387..bbbc8e5 100755 (executable)
@@ -74,7 +74,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     }
 );
 if ( $op eq "renew" ) {
-    my $startdate = output_pref( { str => $query->param('startdate'), dateonly => 1, dateformat => 'iso' } );
+    my $startdate = output_pref( { str => scalar $query->param('startdate'), dateonly => 1, dateformat => 'iso' } );
     ReNewSubscription(
         $subscriptionid, $loggedinuser,
         $startdate, $query->param('numberlength'),
index 53d39a7..0d6006b 100755 (executable)
@@ -302,7 +302,7 @@ $template->param(
     shelf    => $shelf,
     messages => \@messages,
     category => $category,
-    print    => $query->param('print') || 0,
+    print    => scalar $query->param('print') || 0,
     csv_profiles => GetCsvProfilesLoop('marc'),
 );