Bugzilla – Attachment 82551 Details for
Bug 21819
Marc modification templates action always checks Regexp checkbox
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21819: Marc modification templates action always checks Regexp checkbox
Bug-21819-Marc-modification-templates-action-alway.patch (text/plain), 2.97 KB, created by
Marcel de Rooy
on 2018-11-20 15:41:41 UTC
(
hide
)
Description:
Bug 21819: Marc modification templates action always checks Regexp checkbox
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2018-11-20 15:41:41 UTC
Size:
2.97 KB
patch
obsolete
>From ebb8dd75497461f163c918f808c1a0f0eeaa92c5 Mon Sep 17 00:00:00 2001 >From: Andreas Roussos <arouss1980@gmail.com> >Date: Sat, 17 Nov 2018 11:35:00 +0200 >Subject: [PATCH] Bug 21819: Marc modification templates action always checks > Regexp checkbox >Content-Type: text/plain; charset=utf-8 > >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> >--- > .../intranet-tmpl/prog/js/marc_modification_templates.js | 16 ++++++++++------ > 1 file changed, 10 insertions(+), 6 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/marc_modification_templates.js b/koha-tmpl/intranet-tmpl/prog/js/marc_modification_templates.js >index ca08409..6a23270 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/marc_modification_templates.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/marc_modification_templates.js >@@ -255,12 +255,16 @@ function editAction( mmta_id, ordering, action, field_number, from_field, from_s > document.getElementById('field_value').value = field_value; > document.getElementById('to_field').value = to_field; > document.getElementById('to_subfield').value = to_subfield; >- $("#to_regex_search").val(to_regex_search); >- $("#to_regex_replace").val(to_regex_replace); >- $("#to_regex_modifiers").val(to_regex_modifiers); >- >- document.getElementById('to_field_regex').checked = conditional_regex.length; >- document.getElementById('to_field_regex').onchange(); >+ if ( to_regex_search == '' && to_regex_replace == '' && to_regex_modifiers == '' ) { >+ document.getElementById('to_field_regex').checked = false; >+ document.getElementById('to_field_regex').onchange(); >+ } else { >+ document.getElementById('to_field_regex').checked = true; >+ document.getElementById('to_field_regex').onchange(); >+ $("#to_regex_search").val(to_regex_search); >+ $("#to_regex_replace").val(to_regex_replace); >+ $("#to_regex_modifiers").val(to_regex_modifiers); >+ } > > setSelectByValue( 'conditional', conditional ); > document.getElementById('conditional').onchange(); >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21819
:
82424
|
82427
| 82551 |
82552
|
82555