leading articles regexp is not case-insensitive

Bug #1455604 reported by Patrick Gardella
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Confirmed
Medium
Unassigned

Bug Description

Just getting started in Evergreen and until I get git set up properly for a pull request, I thought it would be good to post this change here.

When you enable the "Map of search classes to regular expressions to warn user about leading articles." in Admin -> Server Administration -> Global Flags, it only works for lowercase articles. We're finding our users use capital letters often for Titles, so I'd like to suggest changing it to case-insensitive.

In Open-ILS/src/sql/Pg/950.data.seed-values.sql in line 9823 (for the moment), it currently has:
'{"title": "^(a|the|an)\\s"}',

To make it case insensitive, it should be:
'{"title": "^(?i)(a|the|an)\\s"}',

The update script should be something like this:

UPDATE config.global_flag SET value = '{"title": "^(?i)(a|the|an)\\s"}' WHERE name = 'opac.browse.warnable_regexp_per_class';

This exist in Evergreen 2.5.0 up to master.

Tags: admin-pages
Revision history for this message
Galen Charlton (gmc) wrote :

Thanks! When you get your Git setup sorted and prepare a patch, I have a suggestion for the database update: have it change the global flag value only if its current value is the original seed data value. In other words, don't change if if the user has already set it to a different value:

UPDATE config.global_flag SET value = '{"title": "^(?i)(a|the|an)\\s"}'
WHERE name = 'opac.browse.warnable_regexp_per_class'
AND value <> '{"title": "^(a|the|an)\\s"}';

Revision history for this message
Yamil (ysuarez) wrote :

Patrick, like I said at the conference I would like to collaborate with you on this bug. It would be a learning experience for the both of us. For example, I am comfortable with the git community practices[1], and can help you with them, but I have never made code changes to SQL seed values or a change that is smart enough not to override data during a upgrade. I may also be able to test then sign-off your change so that it can make it to a future EG release.

Good luck,
Yamil

[1] http://wiki.evergreen-ils.org/doku.php?id=dev:git&s[]=git&s[]=dev

tags: added: admin-pages
Changed in evergreen:
status: New → Confirmed
importance: Undecided → Medium
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.