There is an edit button in the tool for MARC template modification for every action of a template. Expected: click edit for an action, get a form populated with the related values. Actual result: page is scrolled to "Add new action", fields are empty.
It does work, unless you have ' in the description, which leads to > SyntaxError: unterminated string literal in Firebug.
I'd really like to see this template overhauled to eliminate all the onclicks.
Created attachment 90196 [details] [review] Bug 15814: Handle correctly MMTA edit button The MARC modification template action edit buton does not correctly handle variable escaping. Assigning a JS variable containing the JSON representation of the hashref will make the processing much more easier. Test plan: Create a MARC Modification Template with several actions. In the description you should use the following characters, to try to break this patch: \ ' " \n \r (not sure what we handled \n and \r) Then edit the action, modify and save again.
Created attachment 90511 [details] [review] Bug 15814: Handle correctly MMTA edit button The MARC modification template action edit buton does not correctly handle variable escaping. Assigning a JS variable containing the JSON representation of the hashref will make the processing much more easier. Test plan: Create a MARC Modification Template with several actions. In the description you should use the following characters, to try to break this patch: \ ' " \n \r (not sure what we handled \n and \r) Then edit the action, modify and save again. Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
QA Script failures.. I think the first one is valid.. not sure about the second FAIL koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt FAIL filters missing_filter at line 166 ( <a class="btn btn-default btn-xs edit_action" href="#modaction" data-mmta_id="[% ActionsLoo.mmta_id %]"><i class="fa fa-pencil"></i> Edit</a>) missing_filter at line 342 ( var mmtas = [% ActionsLoop.json %])
Created attachment 90712 [details] [review] Bug 15814: Add missing filters
Created attachment 90891 [details] [review] Bug 15814: Handle correctly MMTA edit button The MARC modification template action edit buton does not correctly handle variable escaping. Assigning a JS variable containing the JSON representation of the hashref will make the processing much more easier. Test plan: Create a MARC Modification Template with several actions. In the description you should use the following characters, to try to break this patch: \ ' " \n \r (not sure what we handled \n and \r) Then edit the action, modify and save again. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 90892 [details] [review] Bug 15814: Add missing filters Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nice work! Pushed to master for 19.11.00
Pushed to 19.05.x for 19.05.02
backported to 18.11.x for 18.11.08