Bug 7453 - Borrower without expiry date breaks opac login
Summary: Borrower without expiry date breaks opac login
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: 3.6
Hardware: All All
: P5 - low minor (vote)
Assignee: Owen Leonard
QA Contact: Ian Walls
URL:
Keywords:
: 7529 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-01-20 06:57 UTC by Katrin Fischer
Modified: 2013-12-05 19:57 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Adds expiry date to admin user in patron sample data (13.50 KB, patch)
2012-01-20 07:15 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 7453: All patrons should have an expiry date (13.60 KB, patch)
2012-01-28 13:58 UTC, Jared Camins-Esakov
Details | Diff | Splinter Review
Followup to check dateexpiry (1.21 KB, patch)
2012-02-23 09:00 UTC, Marcel de Rooy
Details | Diff | Splinter Review
[SIGNED-OFF] 7453 Followup for borrower without expiry date (1.38 KB, patch)
2012-02-24 06:31 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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.