Summary: | Templates for MARC modification: Edit action does not work when Description contains ' | ||
---|---|---|---|
Product: | Koha | Reporter: | Mirko Tietgen <mirko> |
Component: | Tools | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Nick Clemens <nick> |
Severity: | major | ||
Priority: | P5 - low | CC: | arouss1980, e.betemps, fridolin.somers, jonathan.druart, lucas, martin.renvoize, nick, veron, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
19.11.00,19.05.02
|
|
Bug Depends on: | 8015 | ||
Bug Blocks: | |||
Attachments: |
Bug 15814: Handle correctly MMTA edit button
Bug 15814: Handle correctly MMTA edit button Bug 15814: Add missing filters Bug 15814: Handle correctly MMTA edit button Bug 15814: Add missing filters |
Description
Mirko Tietgen
2016-02-13 10:41:20 UTC
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 |