OPAC maintenance message

Bug #1132000 reported by James Fournie
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Wishlist
Unassigned

Bug Description

I wrote some code for the BC Libraries Cooperative for issuing a maintenance message to JSPAC via an apache environment variable. Thus, you merely add a line like this:

SetEnv MAINTENANCE_MESSAGE "We will be down tomorrow night. Please use the card catalog at that time."

Then apache-reload and a red banner will appear at the top of the OPAC with this message for patrons.

Porting this to TPAC was not difficult, so I have done so and finally am sharing the code here now for your amusement.

Not sure if SetEnv is the best way of doing things in a post-JSPAC world, but it works quite well for notifying everyone who uses the OPAC, particularly any cranky nightowls who may want to use the catalogue while you're doing your maintenance after hours.

user/jamesrf/maintenance_message

Note: I had to add the code to two places in the JSPAC because the home screen (home/index_body.xml) and the rest of the JSPAC (body.xml) have different locations for their <body> tags. For the latter, body.xml, it was necessary to wrap the main table in another div tag, otherwise the locale selector winds up within the alert area and tends to block particularly long messages.

Tags: pullrequest
James Fournie (jfournie)
Changed in evergreen:
importance: Undecided → Wishlist
Revision history for this message
Ben Shum (bshum) wrote :

Fancy, I was just thinking about writing something like this for our libraries too after our last couple upgrades made me feel like we weren't giving folks enough warning.

Not entirely sure about making it an apache variable and not something in config.tt2 or similar instead. Going to ponder that a bit and see if anybody else has opinions about the feature.

Changed in evergreen:
status: New → Confirmed
milestone: none → 2.4.0-beta
Ben Shum (bshum)
Changed in evergreen:
milestone: 2.4.0-beta → 2.4.0-rc
Ben Shum (bshum)
Changed in evergreen:
milestone: 2.4.0-rc → 2.5.0-alpha
Dan Wells (dbw2)
tags: added: pullrequest
Changed in evergreen:
milestone: 2.5.0-m1 → 2.5.0-m2
Revision history for this message
Pasi Kallinen (paxed) wrote :

This doesn't handle UTF-8 characters...

Revision history for this message
Bill Erickson (berick) wrote :

Pasi, what makes you say that? I added this to my Apache configuration and it worked fine in the TPAC. (I didn't test JSPAC).

SetEnv MAINTENANCE_MESSAGE "Biography of César E. Chávez"

Revision history for this message
Pasi Kallinen (paxed) wrote :

Don't know what's different for me then, but I've tried it on two computers, and UTF8 doesn't show up correctly. See image.

Revision history for this message
Bill Erickson (berick) wrote :

That is odd. Here's a shot of my tpac. It looks the same in Chrome and FF.

Revision history for this message
Dan Scott (denials) wrote :

Unicode worked well for me (running both Firefox and Chrome on Fedora 19), and the convenience of this feature is great.

However, I won't merge anything that adds inline CSS, but fortunately that was only in the JSPAC section of the commit, and given that the JSPAC is deprecated, I committed only the TPAC portion of the branch (and tweaked the commit message accordingly). Also, I modified the CSS to use the existing CSS variable for #fff instead of the hard-coded option.

I suppose we should have modified the KPAC while we were at it... but then again, if it's kid-oriented, perhaps server maintenance messages aren't appropriate in that context.

In any case, many thanks, James!

Changed in evergreen:
status: Confirmed → Fix Committed
Revision history for this message
Dan Scott (denials) wrote :

Note... I screwed up this commit, and Ben Shum is currently vetting my correction branch at working/user/dbs/maintenance_message ...

Revision history for this message
Bill Erickson (berick) wrote :

Well, dang, I just got the UTF-8 characters to break. It's fine on the home page and the account pages (after login), but everywhere else (search results, advanced search, etc.) the characters are warbled like Pasi's image. Double encoding?

Revision history for this message
Dan Scott (denials) wrote :

Yay for reproducible test cases!

Please see http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/dbs/maintenance_message_utf8_cleanliness_no_apache_reload_required for a version that:

1. Drops the Apache env approach in favour of config.tt2, as Ben suggested back in March; this fixes the corruption issue and also removes the requirement of reloading Apache to get a message into place, which is convenient. Sites requiring per-host messages can use the ctx.hostname variable to build more complicated logic into their config.tt2.

2. Adds support for the KPAC. Because kids deserve messages too.

Ben Shum (bshum)
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.