Bug 7453

Summary: Borrower without expiry date breaks opac login
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: OPACAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Ian Walls <koha.sekjal>
Severity: minor    
Priority: P5 - low CC: jcamins, m.de.rooy, nikhilvr0, paul.poulain
Version: 3.6   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Adds expiry date to admin user in patron sample data
Bug 7453: All patrons should have an expiry date
Followup to check dateexpiry
[SIGNED-OFF] 7453 Followup for borrower without expiry date

Description Katrin Fischer 2012-01-20 06:57:27 UTC
I ran into this problem while testing, because of some circumstances that are probably very rare:

1) the admin user from patron sample data has no expiry date
2) the sample patrons are written into the database directly
3) I used password change and didn't open the patron record for editing, so the expiry date didn't get calculated

I think it's not possible to add a patron without expiry date using the patron import tool or the staff interface.

But if you follow the described steps or set a patron record's expiry date to NULL in your database, you will get a perl error on login into OPAC:

opac-user.pl: Date::Calc::Add_Delta_Days(): not a valid date at /home/koha2/koha/opac/opac-user.pl line 112., ...
Comment 1 Katrin Fischer 2012-01-20 07:15:23 UTC Comment hidden (obsolete)
Comment 2 Jared Camins-Esakov 2012-01-28 13:58:30 UTC Comment hidden (obsolete)
Comment 3 Paul Poulain 2012-02-03 16:17:55 UTC
QA comment:
 * SQL only, no specific comment, tiny patch
 * tested all files
Comment 4 Marcel de Rooy 2012-02-23 09:00:33 UTC Comment hidden (obsolete)
Comment 5 Marcel de Rooy 2012-02-23 09:02:33 UTC
*** Bug 7529 has been marked as a duplicate of this bug. ***
Comment 6 Katrin Fischer 2012-02-24 06:31:35 UTC
Created attachment 7845 [details] [review]
[SIGNED-OFF] 7453 Followup for borrower without expiry date

While it should be impossible now to have a patron without expiry date, I still had one. It does not hurt to add a simple check on expiry date defined before calling delta days on null values and breaking the opac login.
Trivial change.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested by deleting the expirydate from my own patron record.
Missing expiry date now no longer breaks the summary page
in the patron account on OPAC.
Comment 7 Ian Walls 2012-02-24 20:28:16 UTC
Simple patch adds check for existent expiry date before making use of it's values.

Marking as Passed QA.
Comment 8 Jared Camins-Esakov 2012-05-23 23:39:15 UTC
This will be in the upcoming 3.6.5 release. No string changes.