Bug 21529 - Fix display of HTML tags in print notices
Summary: Fix display of HTML tags in print notices
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 13618
Blocks:
  Show dependency treegraph
 
Reported: 2018-10-10 10:06 UTC by Stefan Berndtsson
Modified: 2022-11-11 10:33 UTC (History)
6 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 21529: (bug 13618 follow-up) Display print notices with HTML tags (1.17 KB, patch)
2018-10-22 20:55 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 21529: (follow-up) USE raw filter (958 bytes, patch)
2018-10-29 14:11 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 21529: (bug 13618 follow-up) Display print notices with HTML tags (1.24 KB, patch)
2018-10-29 14:13 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 21529: (follow-up) USE raw filter (1016 bytes, patch)
2018-10-29 20:43 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 21529: (bug 13618 follow-up) Display print notices with HTML tags (1.29 KB, patch)
2018-10-29 20:43 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 21529: (follow-up) USE raw filter (1.08 KB, patch)
2018-11-02 11:11 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 21529: (bug 13618 follow-up) Display print notices with HTML tags (1.38 KB, patch)
2018-11-02 11:11 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Berndtsson 2018-10-10 10:06:35 UTC
When a print notice letter (for example HOLD) is marked as "HTML message" it is expected for gather_print_notices.pl (with --html) to accept the message content and not escape the html.

Since Bug 13618 this is no longer true. batch/print-notices.tt explicitly adds "| html" before inserting the content regardless of the "HTML message" flag.

circ/printslip.tt on the other hand, checks the flag and escapes only if plain output is used.
Comment 1 Jonathan Druart 2018-10-22 20:55:03 UTC
Created attachment 80992 [details] [review]
Bug 21529: (bug 13618 follow-up) Display print notices with HTML tags

Replace a wrong html filter with raw.

Test plan:
Define a HOLD or DISCHARGE notice template, with html tags.
Generate them and confirm that html tags are displayed (which restore
the existing behaviour prior to bug 13618)
Comment 2 Andrew Isherwood 2018-10-26 09:43:17 UTC
I'm trying to sign this one off, but after I apply the patch I receive the following error when running gather_print_notices.pl:

Template process failed: undef error - : filter not found at /home/koha/kohaclone/C4/Templates.pm line 122.

I'm mystified as to what could be causing it since I can't see anything wrong with your patch. Any ideas?
Comment 3 Andrew Isherwood 2018-10-29 14:11:37 UTC
Created attachment 81503 [details] [review]
Bug 21529: (follow-up) USE raw filter

In order to be able to make use of the $raw filter, we need to USE it
first
Comment 4 Andrew Isherwood 2018-10-29 14:13:41 UTC
Created attachment 81505 [details] [review]
Bug 21529: (bug 13618 follow-up) Display print notices with HTML tags

Replace a wrong html filter with raw.

Test plan:
Define a HOLD or DISCHARGE notice template, with html tags.
Generate them and confirm that html tags are displayed (which restore
the existing behaviour prior to bug 13618)

Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com>
Comment 5 Katrin Fischer 2018-10-29 20:43:46 UTC
Created attachment 81545 [details] [review]
Bug 21529: (follow-up) USE raw filter

In order to be able to make use of the $raw filter, we need to USE it
first

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Katrin Fischer 2018-10-29 20:43:50 UTC
Created attachment 81546 [details] [review]
Bug 21529: (bug 13618 follow-up) Display print notices with HTML tags

Replace a wrong html filter with raw.

Test plan:
Define a HOLD or DISCHARGE notice template, with html tags.
Generate them and confirm that html tags are displayed (which restore
the existing behaviour prior to bug 13618)

Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 7 Marcel de Rooy 2018-11-02 11:11:49 UTC
Created attachment 81885 [details] [review]
Bug 21529: (follow-up) USE raw filter

In order to be able to make use of the $raw filter, we need to USE it
first

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 8 Marcel de Rooy 2018-11-02 11:11:53 UTC
Created attachment 81886 [details] [review]
Bug 21529: (bug 13618 follow-up) Display print notices with HTML tags

Replace a wrong html filter with raw.

Test plan:
Define a HOLD or DISCHARGE notice template, with html tags.
Generate them and confirm that html tags are displayed (which restore
the existing behaviour prior to bug 13618)

Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 9 Marcel de Rooy 2018-11-16 16:02:02 UTC
Nick,
You are holding this patch for some reason. Perhaps because of the suggested dependency on bug 21679. Please check that: I do not see why they are dependent. Am I missing something ?
Comment 10 Katrin Fischer 2018-11-16 16:27:06 UTC
I think the dependency is false - I've remove it.
Comment 11 Nick Clemens 2018-11-21 11:34:43 UTC
Awesome work all!

Pushed to master for 18.11
Comment 12 Lucas Gass 2018-12-07 18:56:51 UTC
backported to 18.05 for 18.05.07
Comment 13 Jonathan Druart 2018-12-12 12:29:26 UTC
(In reply to Lucas Gass from comment #12)
> backported to 18.05 for 18.05.07

Why? Did you see the bug on 18.05?

Bug 13618 is not in this version so I do not think the bug exists (I did not check).
Jenkins is complaining about that one anyway:

koha_1       | #   Failed test '/kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/modules/batch/print-notices.tt'
koha_1       | #   at xt/author/valid-templates.t line 141.
koha_1       | # plugin error - raw: plugin not found

Patch using the raw plugin ([% var | $raw %]) should not be backported as the plugin does not exist in 18.05 (which you may want to consider at some point).
Comment 14 Lucas Gass 2018-12-12 17:32:37 UTC
reverted from 18.05