[open-ils-commits] [GIT] Evergreen ILS branch rel_3_0 updated. 12c6acbded284d055a227b89b29f4dc8ddde637b
Evergreen Git
git at git.evergreen-ils.org
Fri May 25 14:15:59 EDT 2018
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, rel_3_0 has been updated
via 12c6acbded284d055a227b89b29f4dc8ddde637b (commit)
from 9374c73dd9c6db7c98bc3371a99e82227141a64c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 12c6acbded284d055a227b89b29f4dc8ddde637b
Author: Jeff Davis <jdavis at sitka.bclibraries.ca>
Date: Thu Mar 1 16:55:46 2018 -0800
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 at sitka.bclibraries.ca>
Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
Signed-off-by: Mike Rylander <mrylander at gmail.com>
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm
index 016aba3..bd6775a 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm
@@ -273,7 +273,13 @@ sub init_ro_object_cache {
if ($context_org) {
$context_org = $context_org->id if ref($context_org);
my $tz = $locale_subs->{get_org_setting}->($context_org,'lib.timezone');
- $date->set_time_zone($tz) if ($tz);
+ if ($tz) {
+ try {
+ $date->set_time_zone($tz);
+ } catch Error with {
+ $logger->warn("Invalid timezone: $tz");
+ };
+ }
}
return sprintf(
"%0.2d:%0.2d:%0.2d %0.2d-%0.2d-%0.4d",
-----------------------------------------------------------------------
Summary of changes:
.../perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list