Bug 27930

Summary: Move _escape_* functions from acq/parcel.tt to be re-usable
Product: Koha Reporter: Martin Renvoize <martin.renvoize>
Component: Architecture, internals, and plumbingAssignee: Martin Renvoize <martin.renvoize>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: andrewfh, fridolin.somers, jonathan.druart, joonas.kylmala, nick, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
This enhancement moves the useful `_escape_price` and `_escape_str` functions found in acq/parcel.tt into the re-usable staff-global.js include file.
Version(s) released in:
21.05.00,20.11.04
Bug Depends on:    
Bug Blocks: 26273    
Attachments: Bug 27930: Move _escape_* from acqui/parcel.tt to js/staff-global.js
Bug 27930: Move _escape_* from acqui/parcel.tt to js/staff-global.js
Bug 27930: [stables] Move _escape_* from acqui/parcel.tt to js/staff-global.js

Description Martin Renvoize 2021-03-11 14:20:29 UTC
A pair of very simple but very useful escaping functions can be found in parcel.tt. They should be moved into staff-global.js so they can be adopted more widely.
Comment 1 Martin Renvoize 2021-03-11 14:27:31 UTC
Created attachment 118128 [details] [review]
Bug 27930: Move _escape_* from acqui/parcel.tt to js/staff-global.js

This patch moves the _escape_str and _escape_price functions into the
staff-global.js include

Test plan
1/ The acquisitions parcel page should look the same before and after
the patch.
2/ Signoff
Comment 2 Jonathan Druart 2021-03-11 15:36:02 UTC
Created attachment 118153 [details] [review]
Bug 27930: Move _escape_* from acqui/parcel.tt to js/staff-global.js

This patch moves the _escape_str and _escape_price functions into the
staff-global.js include

Test plan
1/ The acquisitions parcel page should look the same before and after
the patch.
2/ Signoff

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 3 Jonathan Druart 2021-03-11 15:37:52 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 4 Jonathan Druart 2021-03-11 15:41:43 UTC
Created attachment 118154 [details] [review]
Bug 27930: [stables] Move _escape_* from acqui/parcel.tt to js/staff-global.js

This patch moves the _escape_str and _escape_price functions into the
staff-global.js include

Test plan
1/ The acquisitions parcel page should look the same before and after
the patch.
2/ Signoff

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Note: For stable branch the functions didn't exist.
Comment 5 Jonathan Druart 2021-03-11 15:42:42 UTC
RMaints, I would recommend you to pick this one to anticipate a call to a missing function when backporting a patch.
Comment 6 Fridolin Somers 2021-03-19 14:30:30 UTC
(In reply to Jonathan Druart from comment #5)
> RMaints, I would recommend you to pick this one to anticipate a call to a
> missing function when backporting a patch.

Good point.
Comment 7 Fridolin Somers 2021-03-19 14:40:17 UTC
Ah but _escape_* methods have been added by Bug 20212 not backported, that why there is a "stable" patch.
OK
Comment 8 Fridolin Somers 2021-03-19 14:41:13 UTC
Pushed to 20.11.x for 20.11.04
Comment 9 Andrew Fuerste-Henry 2021-03-23 12:46:26 UTC
Not backported to 20.05