Bug 16864: Silence warnings in t/db_dependent/ILSDI_Services.t
authorMark Tompsett <mtompset@hotmail.com>
Wed, 6 Jul 2016 18:17:20 +0000 (14:17 -0400)
committerBrendan Gallagher <brendan@bywatersolutions.com>
Thu, 4 Aug 2016 20:06:07 +0000 (20:06 +0000)
prove t/db_dependent/ILSDI_Services.t
generates noisy output as a result of the ambiguous context
of two $cgi->param() calls.

By storing into scalar variables, and then using the scalar
variables, the code maintains readability and fixes the problem.

TEST PLAN
---------
1) prove t/db_dependent/ILSDI_Services.t
   -- noisy.
2) apply patch
3) prove t/db_dependent/ILSDI_Services.t
   -- not noisy
4) run koha qa test tools

Signed-off-by: Marc <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
C4/ILSDI/Services.pm

index 9f5a766..2820fef 100644 (file)
@@ -321,7 +321,9 @@ Parameters:
 
 sub AuthenticatePatron {
     my ($cgi) = @_;
-    my ($status, $cardnumber, $userid) = C4::Auth::checkpw( C4::Context->dbh, $cgi->param('username'), $cgi->param('password') );
+    my $username = $cgi->param('username');
+    my $password = $cgi->param('password');
+    my ($status, $cardnumber, $userid) = C4::Auth::checkpw( C4::Context->dbh, $username, $password );
     if ( $status ) {
         # Get the borrower
         my $borrower = GetMember( cardnumber => $cardnumber );