Bug 18552: [QA Follow-up] Resolve warnings
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Fri, 19 May 2017 10:22:03 +0000 (12:22 +0200)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 19 May 2017 14:35:48 +0000 (10:35 -0400)
Like:
Problem = a value of AutoResumeSuspendedHolds has been passed to param without key at /usr/share/koha/masterclone/C4/Templates.pm line 137.
Problem = a value of relatives_borrowernumbers has been passed to param without key at /usr/share/koha/masterclone/C4/Templates.pm line 137.

Problem is functions returning undef in list context (in this case
housebound_role).
No need to call Patrons::find a second time.

Note: The call of GetDebarments in the first patch suffered from this too.
It is in a fine place now too. But strictly speaking, should not have been
moved.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
members/moremember.pl

index 0027099..0e18d22 100755 (executable)
@@ -343,6 +343,7 @@ my $translated_language = C4::Languages::language_get_description( $subtag, $sub
 
 $template->param(
     patron          => $patron,
+    borrower        => $patron, # TODO Still needed by includes,
     translated_language => $translated_language,
     detailview      => 1,
     borrowernumber  => $borrowernumber,
@@ -354,11 +355,11 @@ $template->param(
     totaldue        => sprintf("%.2f", $total),
     totaldue_raw    => $total,
     overdues_exist  => $overdues_exist,
-    StaffMember     => ($category_type eq 'S'),
-    is_child        => ($category_type eq 'C'),
+    StaffMember     => $category_type eq 'S',
+    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'),
@@ -366,7 +367,6 @@ $template->param(
     PatronsPerPage => C4::Context->preference("PatronsPerPage") || 20,
     relatives_issues_count => $relatives_issues_count,
     relatives_borrowernumbers => \@relatives,
-    borrower => Koha::Patrons->find( $borrowernumber ),
 );
 
 output_html_with_http_headers $input, $cookie, $template->output;