Bug 21552 - RoutingListNote should use raw filter and display HTML unescaped
Summary: RoutingListNote should use raw filter and display HTML unescaped
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Serials (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Katrin Fischer
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-11 19:54 UTC by Katrin Fischer
Modified: 2020-01-06 20:15 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 21552: Use raw filter for displaying RoutingListNote (2.08 KB, patch)
2018-10-11 22:10 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 21552: Use raw filter for displaying RoutingListNote (2.15 KB, patch)
2018-10-12 20:41 UTC, Pierre-Marc Thibault
Details | Diff | Splinter Review
Bug 21552: Use raw filter for displaying RoutingListNote (2.20 KB, patch)
2018-10-15 21:20 UTC, Chris Cormack
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2018-10-11 19:54:40 UTC
The routing list note as visible on the routing list preview is supposed to work like other HTML notes and display rendered unescaped HTML.
Comment 1 Katrin Fischer 2018-10-11 22:10:57 UTC
Created attachment 80437 [details] [review]
Bug 21552: Use raw filter for displaying RoutingListNote

The RoutingListNote system preference works like other prefs
allowing you to insert your own content on the routling list
template using HTML. The default text even uses HTML, so it
looks broken without this patch.

To test:
- Add a subscription
- Add a new routing list to it
- Add some patrons to it
- Save
- preview routing list
- Verify that the note shows and is formatted correctly.
Comment 2 Pierre-Marc Thibault 2018-10-12 19:56:30 UTC
I put some custom html in the RoutingListNote preference and looked at the preview. It does not seem there is a problem in the first place as there are no html nodes in the preview I opened by clicking "Save and preview routing slip". Am I missing a step?
Comment 3 Katrin Fischer 2018-10-12 20:00:05 UTC
Hi Pierre-Marc,

on master it shows for me:

To change this note edit <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=RoutingListNote#jumped">RoutingListNote</a> system preference.

So the HTML shows unrendered. Can you check if you have the patch applied already and what you put into the preference?
Comment 4 Pierre-Marc Thibault 2018-10-12 20:23:18 UTC
Hi Katrin,

I can confirm that the patch has not been applied. In the reference, I decided to insert the message you see on master :

To change this note edit <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=RoutingListNote#jumped">RoutingListNote</a> system preference.

and what I see is :

To change this note edit RoutingListNote system preference.

I don't know why, but I don't have a problem on my side. Do you know why the current code is not working correctly?
Comment 5 Katrin Fischer 2018-10-12 20:26:42 UTC
I have no idea as it really should not work as there is a html filter on the element in master. :( Are you on recent master?
Comment 6 Pierre-Marc Thibault 2018-10-12 20:34:23 UTC
Sorry Katrin,

I took the wrong tab to do my tests. I shall corrige this immediately and sign off this ASAP I confirm the validity of your patch. :)
Comment 7 Pierre-Marc Thibault 2018-10-12 20:41:57 UTC
Created attachment 80564 [details] [review]
Bug 21552: Use raw filter for displaying RoutingListNote

The RoutingListNote system preference works like other prefs
allowing you to insert your own content on the routling list
template using HTML. The default text even uses HTML, so it
looks broken without this patch.

To test:
- Add a subscription
- Add a new routing list to it
- Add some patrons to it
- Save
- preview routing list
- Verify that the note shows and is formatted correctly.

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Comment 8 Pierre-Marc Thibault 2018-10-12 20:45:27 UTC
Hopefully this makes up my mistake. The problem was here and the patch fixes it.
Comment 9 Katrin Fischer 2018-10-12 20:46:00 UTC
Thx! you had me a little worried there :)
Comment 10 Chris Cormack 2018-10-15 21:20:55 UTC
Created attachment 80645 [details] [review]
Bug 21552: Use raw filter for displaying RoutingListNote

The RoutingListNote system preference works like other prefs
allowing you to insert your own content on the routling list
template using HTML. The default text even uses HTML, so it
looks broken without this patch.

To test:
- Add a subscription
- Add a new routing list to it
- Add some patrons to it
- Save
- preview routing list
- Verify that the note shows and is formatted correctly.

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Comment 11 Nick Clemens 2018-10-17 19:25:56 UTC
Awesome work all!

Pushed to master for 18.11
Comment 12 Martin Renvoize 2018-10-26 11:45:19 UTC
Pushed to 18.05.x for 18.05.06
Comment 13 Fridolin Somers 2018-11-09 11:56:34 UTC
This is not needed for 17.11.x because generalroutingnote is not html filtered.