Bug 21819: Marc modification templates action always checks Regexp checkbox
authorAndreas Roussos <arouss1980@gmail.com>
Sat, 17 Nov 2018 09:35:00 +0000 (11:35 +0200)
committerNick Clemens <nick@bywatersolutions.com>
Wed, 21 Nov 2018 11:30:48 +0000 (11:30 +0000)
commita9fc00db03a8210b3edb69a922209a4e8f6df9a1
tree5fa24b4e03e22deeb444e399e99eec6440544f56
parent9316001126953c41985eb2853fc25163362591d1
Bug 21819: Marc modification templates action always checks Regexp checkbox

When editing a MARC modification template action, the 'RegEx'
checkbox to the right of the 'to field' textboxes will always
appear checked, even if no regular expression has been added.

This patch fixes that.

Test plan (steps 1-5 are copied from the original report -- thanks Pasi!):
1) Go to Tools > Marc modification templates, and create a new template
2) Add a new action to the template
3) Edit the action so it's "Move" field to another field.
   Do not check the RegEx checkbox after the "To" field.
4) Save the action.
5) Edit the same action again. The checkbox is now checked.
6) Apply the patch and hit Ctrl-F5 to do a hard refresh in your browser.
7) Edit the action you saved in 4): this time the 'RegEx' checkbox
   should be unchecked.
8) For completeness, add a regular expression to the "Move" action
   created in 3) and click on 'Update action'. When you re-edit this
   action the 'RegEx' checkbox should be checked.

Signed-off-by: Pasi Kallinen <pasi.kallinen@joensuu.fi>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
koha-tmpl/intranet-tmpl/prog/js/marc_modification_templates.js