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

Josh Stompro stomproj at exchange.larl.org
Mon Nov 24 11:15:15 EST 2014


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/templates/conify/global/action_trigger/event_definition.tt2;h=5908cc9d77e62a9f1af86939e3d6a9077fc37e1b;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/b5891692/attachment.htm>


More information about the Open-ils-dev mailing list