[OPEN-ILS-DEV] Action Trigger Granularity Case Sensitive

Michael Peters mpeters at emeralddata.net
Mon Nov 24 12:34:29 EST 2014


I noticed the case sensitivity issue back in 2.6.2 when upgrading a
customer.  They went through a week or two without overdue notices because
of the case sensitivity in the granularity.  Previously, they didn't have
issues and we didn't update the crontab at the time of upgrade.

 

It would be great to get this consistent so the example crontab works
again.  I am not confident it would work in a system built from master
right now because of the mismatches you have described.

 

Michael Peters
Senior Systems Analyst
Emerald Data Networks, Inc.
Phone: 678.302.3000 x1013
Help Desk: 678.302.3000 x1500
www.emeralddata.net 

From: open-ils-dev-bounces at list.georgialibraries.org
[mailto:open-ils-dev-bounces at list.georgialibraries.org] On Behalf Of Josh
Stompro
Sent: Monday, November 24, 2014 11:15 AM
To: Evergreen Development Discussion List
Subject: [OPEN-ILS-DEV] Action Trigger Granularity Case Sensitive

 

Hello, I would like to resolve an issue with how the Granularity field
handles case, but I just want some feedback on if it is a problem or not?
I just want to make this easy to use for new users so they don't hit the
issue that I ran into.  I'm using a 2.7.1 test system.

 

I used the cron example on the wiki - which uses low case granularity
identifiers.  "hourly" for instance.  Maybe there is an updated cron
example that doesn't have this problem though?  The
examples/crontab.example file also uses lowercase granularity names.

http://wiki.evergreen-ils.org/doku.php?id=evergreen-admin:cron_services

 

When editing the action trigger event definition from the staff client,
there are certain default granularities setup to be in a dropdown list.
This list seems to be setup in
src/templates/conify/global/action_trigger/event_definition.tt2
<http://git.evergreen-ils.org/?p=Evergreen.git;a=blob;f=Open-ILS/src/templ
ates/conify/global/action_trigger/event_definition.tt2;h=5908cc9d77e62a9f1
af86939e3d6a9077fc37e1b;hb=HEAD>  - 

 

<div class='hidden'>

7     <select dojoType='dijit.form.ComboBox' jsId='eventDefGranularity'>

8         <option value='hourly'>[% l('Hourly') %]</option>

9         <option value='daily'>[% l('Daily') %]</option>

10         <option value='weekly'>[% l('Weekly') %]</option>

11         <option value='monthly'>[% l('Monthly') %]</option>

12         <option value='yearly'>[% l('Yearly') %]</option>

13     </select>

14 </div>

 

It looks like it tries to display "Hourly" but set the value to 'hourly',
but that isn't how it actually works, it sets the actual value of the
granularity field in action_trigger.event_definition to "Hourly".
Probably because it is a ComboBox that allows user input, so it has to use
the displayed value.

 

Another issue might be that those strings are translated, so the
granularity values will be set to whatever they are translated into to, so
the cron settings would need to be set accordingly.

 

And it isn't possible to manually enter "hourly", it gets auto corrected
to "Hourly".

 

So the simple solution would be to update the crontab examples on the wiki
and in the source to use "Hourly", "Yearly", "Weekly" for the -granularity
setting.  Michael Peters posted what his crontab looks like in 9/12/2012
and he has them capitalized.

 

Or should there be a tolower added when the granularity field gets saved,
so its contents are always saved in lower case?  This would cause problems
for sites upgrading that have already run into this issue and set their
crontab to the case sensitive values.

 

Thanks

Josh

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libmail.georgialibraries.org/pipermail/open-ils-dev/attachments/20141124/3cc3e523/attachment.htm>


More information about the Open-ils-dev mailing list