Bug 18179: Update existing calls
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 18 Apr 2017 16:50:36 +0000 (13:50 -0300)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 28 Apr 2017 10:48:31 +0000 (06:48 -0400)
This patch updates the existing occurrences of ->find called in a list
context.
There are certainly others that are not easy to catch with git grep.
Test plan:
Confirm that the 4 modified scripts still works as expected.

We need this one ASAP in master to make sure we will not get other
side-effects of this kind and to catch possible uncaught occurrences
before the release.

Tested scripts changed by this patch, they work as expected.
Signed-off-by: Marc VĂ©ron <veron@veron.ch>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
members/memberentry.pl
members/moremember.pl
members/pay.pl
opac/opac-user.pl

index 768b163..c13faa5 100755 (executable)
@@ -753,7 +753,7 @@ $template->param( csrf_token =>
 
 # HouseboundModule data
 $template->param(
-    housebound_role  => Koha::Patron::HouseboundRoles->find($borrowernumber),
+    housebound_role  => scalar Koha::Patron::HouseboundRoles->find($borrowernumber),
 );
 
 if(defined($data{'flags'})){
index 4f88862..9d76d76 100755 (executable)
@@ -346,7 +346,7 @@ $template->param(
     is_child        => ($category_type eq 'C'),
     samebranch      => $samebranch,
     quickslip       => $quickslip,
-    housebound_role => $patron->housebound_role,
+    housebound_role => scalar $patron->housebound_role,
     privacy_guarantor_checkouts => $data->{'privacy_guarantor_checkouts'},
     AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds'),
     SuspendHoldsIntranet => C4::Context->preference('SuspendHoldsIntranet'),
index 2e25eef..3400ee0 100755 (executable)
@@ -94,7 +94,7 @@ if ($writeoff_all) {
     Koha::Account->new( { patron_id => $borrowernumber } )->pay(
         {
             amount     => $amount,
-            lines      => [Koha::Account::Lines->find($accountlines_id)],
+            lines      => [ scalar Koha::Account::Lines->find($accountlines_id) ],
             type       => 'writeoff',
             note       => $payment_note,
             library_id => $branch,
@@ -208,7 +208,7 @@ sub writeoff_all {
             Koha::Account->new( { patron_id => $borrowernumber } )->pay(
                 {
                     amount => $amount,
-                    lines  => [ Koha::Account::Lines->find($accountlines_id) ],
+                    lines  => [ scalar Koha::Account::Lines->find($accountlines_id) ],
                     type   => 'writeoff',
                     note   => $payment_note,
                     library_id => $branch,
index 3dc39bf..adba791 100755 (executable)
@@ -337,7 +337,7 @@ if (   C4::Context->preference('AllowPatronToSetCheckoutsVisibilityForGuarantor'
 }
 
 $template->param(
-    borrower                 => Koha::Patrons->find($borrowernumber),
+    borrower                 => scalar Koha::Patrons->find($borrowernumber),
     patron_messages          => $patron_messages,
     opacnote                 => $borr->{opacnote},
     patronupdate             => $patronupdate,