Bug 36878

Summary: Spurious warnings in C4::ILSDI::AuthenticatePatron
Product: Koha Reporter: Andreas Jonsson <andreas.jonsson>
Component: OPACAssignee: Andreas Jonsson <andreas.jonsson>
Status: Failed QA --- QA Contact: Testopia <testopia>
Severity: trivial    
Priority: P5 - low CC: david, nick
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 36878: Silence spurious warning in C4::ILSDI
Bug 36878: Silence spurious warning in C4::ILSDI

Description Andreas Jonsson 2024-05-16 07:21:58 UTC
Spurious warning about undefined variable in logfiles.
Comment 1 Andreas Jonsson 2024-05-16 07:25:42 UTC
Created attachment 166803 [details] [review]
Bug 36878: Silence spurious warning in C4::ILSDI

Test plan:

Review patch and verify that:

* the only effect is that no warning will be emitted
  in the event the variable $status is undefined, and
* the variable $status being undefined is normal and
  harmless.
Comment 2 Chris Cormack 2024-06-07 08:03:03 UTC
Created attachment 167561 [details] [review]
Bug 36878: Silence spurious warning in C4::ILSDI

Test plan:

Review patch and verify that:

* the only effect is that no warning will be emitted
  in the event the variable $status is undefined, and
* the variable $status being undefined is normal and
  harmless.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Comment 3 Nick Clemens (kidclamp) 2024-06-24 23:12:27 UTC
In what case is status expected to be undefined? It is the first return variable from checkpw which should be 1,0,-1 according to the code
Comment 4 Andreas Jonsson 2024-08-24 19:30:17 UTC
The warnings in the logfile makes it apparent that $status occasionally is undefined.

checkpw is a messy subroutine, but two apparent cases where $status is undefined is $patron->account_locked and $stored_hash eq '!'.