Invalid lib.timezone breaks record summary

Bug #1752753 reported by Jeff Davis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned
3.0
Fix Released
Medium
Unassigned

Bug Description

Evergreen 3.0

If you have an invalid timezone value for the lib.timezone org setting, attempting to view a record in the OPAC results in an internal server error.

Steps to reproduce:
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.

It appears that only valid tzdata timezone names are acceptable values for lib.timezone, so "America/Vancouver" will work but "Pacific Time Zone" or "PST" will cause the 500 error in the OPAC.

Revision history for this message
Jeff Davis (jdavis-sitka) wrote :

Working branch user/jeffdavis/lp1752753-invalid-timezone has a minimal fix, using try/catch to avoid an internal server error on invalid timezone values. Better documentation (including an updated description for the setting) would also help.

Revision history for this message
Mike Rylander (mrylander) wrote :

For reference, we're using DateTime::Timezone there. The note at http://search.cpan.org/~drolsky/DateTime-TimeZone-2.17/lib/DateTime/TimeZone.pm#$tz->short_name_for_datetime(_$dt_) is relevant.

Thanks, Jeff!

Revision history for this message
Galen Charlton (gmc) wrote :

Also see wishlist bug 1754364.

Revision history for this message
Mike Rylander (mrylander) wrote :

And, until bug 1754364 turns into code, a good reference for valid timezone names exists at:

https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

We need a Canonical (under the Format column) tz name. Alias and other formats may not be recognized in various parts of the code.

Revision history for this message
Jeff Davis (jdavis-sitka) wrote :

Regardless of whatever else we do with timezone settings, I think we want the fix shared here, so I'm adding a pullrequest.

tags: added: pullrequest
Revision history for this message
Galen Charlton (gmc) wrote :

Pushed a signoff to user/gmcharlt/lp1752753_signoff; the signoff includes a squashed replacement of an error "$z" with "$tz".

tags: added: signedoff
Galen Charlton (gmc)
Changed in evergreen:
status: New → Confirmed
importance: Undecided → Medium
Dan Wells (dbw2)
no longer affects: evergreen/3.1
Changed in evergreen:
milestone: none → 3.1-rc
Changed in evergreen:
milestone: 3.1-rc → 3.1.1
Changed in evergreen:
milestone: 3.1.1 → 3.1.2
Revision history for this message
Mike Rylander (mrylander) wrote :

Picked into master through 3.0. Thanks, Jeff and Galen!

Changed in evergreen:
status: Confirmed → Fix Committed
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.