Invalid lib.timezone breaks record summary

Bug #1752753 reported by Jeff Davis on 2018-03-02
This bug affects 1 person
Affects Status Importance Assigned to Milestone

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.

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.

Mike Rylander (mrylander) wrote :

For reference, we're using DateTime::Timezone there. The note at$tz->short_name_for_datetime(_$dt_) is relevant.

Thanks, Jeff!

Galen Charlton (gmc) wrote :

Also see wishlist bug 1754364.

Mike Rylander (mrylander) wrote :

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

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

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
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) on 2018-03-14
Changed in evergreen:
status: New → Confirmed
importance: Undecided → Medium
Dan Wells (dbw2) on 2018-03-20
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
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  Edit
Everyone can see this information.

Other bug subscribers