]> git.evergreen-ils.org Git - working/Evergreen.git/commit
LP#1752753: Guard against invalid timezone
authorJeff Davis <jdavis@sitka.bclibraries.ca>
Fri, 2 Mar 2018 00:55:46 +0000 (16:55 -0800)
committerMike Rylander <mrylander@gmail.com>
Fri, 25 May 2018 18:15:34 +0000 (14:15 -0400)
commita823238c86976f78b1b672d3c9852cebc9d4d855
treec6d3d20ff019bf9f57f5c33624f19e0ac873e78a
parentef3c180f82c30274709a923c6b56fc11150b1079
LP#1752753: Guard against invalid timezone

If the lib.timezone org setting is not a valid timezone, attempting to
use it can result in an internal server error in the OPAC.  Let's handle
the error with try/catch instead.

To test
-------
1. In Library Settings Editor, edit the "Library time zone" setting for
   Example Branch 1, setting the value to something that's not the name
   of a time zone (like "invalid" or "UTC-07:00").
2. In the OPAC, retrieve a record with holdings at Example Branch 1.
    You will get an Internal Server Error.
3. Edit the library setting to use a valid timezone name, like
   "America/Vancouver".
4. Retrieve the same record again. This time, the record will display
   properly.
5. Apply the patch and repeat steps 1 and 2; this time, there should
   be no internal server error.

Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm