Bug 23409 - Show circulation note and OPAC note with line feeds
Summary: Show circulation note and OPAC note with line feeds
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Alex Arnaud
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-01 09:37 UTC by Alex Arnaud
Modified: 2020-11-30 21:46 UTC (History)
7 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:
20.05.00, 19.11.05


Attachments
Bug 23409 - show borrowernotes and opacnote's lines feeds (1.12 KB, patch)
2019-08-01 12:51 UTC, Alex Arnaud
Details | Diff | Splinter Review
Bug 23409 - show borrowernotes and opacnote's lines feeds (2.14 KB, patch)
2019-08-01 13:31 UTC, Alex Arnaud
Details | Diff | Splinter Review
Bug 23409 - show borrowernotes and opacnote's lines feeds (2.09 KB, patch)
2019-08-13 08:26 UTC, Alex Arnaud
Details | Diff | Splinter Review
Bug 23409: show borrowernotes and opacnote's lines feeds (2.09 KB, patch)
2019-08-13 08:29 UTC, Alex Arnaud
Details | Diff | Splinter Review
Bug 23409: show borrowernotes and opacnote's lines feeds (2.16 KB, patch)
2019-08-15 21:17 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 23409: (follow-up) Allow HTML in circulation note and add line breaks in OPAC user account (2.74 KB, patch)
2019-08-15 21:17 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 23409: show borrowernotes and opacnote's lines feeds (2.21 KB, patch)
2020-02-27 18:40 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 23409: (follow-up) Allow HTML in circulation note and add line breaks in OPAC user account (2.91 KB, patch)
2020-02-27 18:40 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 23409: show borrowernotes and opacnote's lines feeds (2.27 KB, patch)
2020-03-22 17:52 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 23409: (follow-up) Allow HTML in circulation note and add line breaks in OPAC user account (2.97 KB, patch)
2020-03-22 17:52 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Arnaud 2019-08-01 09:37:11 UTC
Currently, lines feeds typed in borrowernotes and opacnote are not visible in the interface. 
Patch is coming.
Comment 1 Alex Arnaud 2019-08-01 12:51:13 UTC Comment hidden (obsolete)
Comment 2 Katrin Fischer 2019-08-01 13:03:01 UTC
Hi Alex,

I think there is a nicer way to solve this using TT filters. I've seen them used in quite a few places already.

http://www.template-toolkit.org/docs/manual/Filters.html#section_html_line_break
Comment 3 Alex Arnaud 2019-08-01 13:31:05 UTC Comment hidden (obsolete)
Comment 4 Katrin Fischer 2019-08-01 13:37:19 UTC
Instead of:

+                                                [% FILTER html_line_break %]
+                                                    [% patron.opacnote | html %]
+                                                [% END %]

You can just do:

[% patron.opacnote | html | html_line_break %] 

(I think we first want to espace, then make br so the br are not esacped)
Comment 5 Fridolin Somers 2019-08-01 15:24:27 UTC
(In reply to Katrin Fischer from comment #4)
> Instead of:
> 
> +                                                [% FILTER html_line_break %]
> +                                                    [% patron.opacnote |
> html %]
> +                                                [% END %]
> 
> You can just do:
> 
> [% patron.opacnote | html | html_line_break %] 
> 
> (I think we first want to espace, then make br so the br are not esacped)

Indeed, its much better ;)
See existing :
[% subscription.notes | html | html_line_break %]
Comment 6 Fridolin Somers 2019-08-01 15:33:14 UTC
patron.opacnote exists in other places :
koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt
koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-note.inc

borrowernotes exists in a lot of other places.

BTW html filter should always be used, not $raw.
Comment 7 Katrin Fischer 2019-08-10 20:55:33 UTC
Hi Alex, will you have a chance to submit an updated patch?
Comment 8 Alex Arnaud 2019-08-13 08:26:59 UTC Comment hidden (obsolete)
Comment 9 Alex Arnaud 2019-08-13 08:29:13 UTC
Created attachment 92173 [details] [review]
Bug 23409: show borrowernotes and opacnote's lines feeds

Test plan:
  - Fill borrowernotes and opacnote with lines separated by lines
    endings,
  - save and check the content is displayed on a single line,
  - apply this patch,
  - check lines endings are displayed
Comment 10 Katrin Fischer 2019-08-15 21:17:09 UTC
Created attachment 92246 [details] [review]
Bug 23409: show borrowernotes and opacnote's lines feeds

Test plan:
  - Fill borrowernotes and opacnote with lines separated by lines
    endings,
  - save and check the content is displayed on a single line,
  - apply this patch,
  - check lines endings are displayed

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Katrin Fischer 2019-08-15 21:17:13 UTC
Created attachment 92247 [details] [review]
Bug 23409: (follow-up) Allow HTML in circulation note and add line breaks in OPAC user account

This patch makes 2 changes:
- bug 22702 allowed adding HTML to the circulation note, so this patch
  restores that ability.
- display OPAC note and messages as multi-line in OPAC

To test:
- Add a circulation and an OPAC note with line breaks and HTML tags
  to the patron account
- Add a message with line breaks to the patron account
- Check line breaks don't show on
  - OPAC > patron account > my summary page
  - Staff > patron account > details
- Apply patches
- Repeat test
Comment 12 Katrin Fischer 2019-08-15 21:19:01 UTC
Added a follow-up - can you check Alex? 

Changes in OPAC are debatable on this bug report, but I think we really need to put back the $raw because of bug 22702.
Comment 13 Bernardo Gonzalez Kriegel 2020-02-27 18:40:01 UTC
Created attachment 99712 [details] [review]
Bug 23409: show borrowernotes and opacnote's lines feeds

Test plan:
  - Fill borrowernotes and opacnote with lines separated by lines
    endings,
  - save and check the content is displayed on a single line,
  - apply this patch,
  - check lines endings are displayed

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Comment 14 Bernardo Gonzalez Kriegel 2020-02-27 18:40:04 UTC
Created attachment 99713 [details] [review]
Bug 23409: (follow-up) Allow HTML in circulation note and add line breaks in OPAC user account

This patch makes 2 changes:
- bug 22702 allowed adding HTML to the circulation note, so this patch
  restores that ability.
- display OPAC note and messages as multi-line in OPAC

To test:
- Add a circulation and an OPAC note with line breaks and HTML tags
  to the patron account
- Add a message with line breaks to the patron account
- Check line breaks don't show on
  - OPAC > patron account > my summary page
  - Staff > patron account > details
- Apply patches
- Repeat test

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Notes and messages show line breaks in OPAC, Notes on staff
HTML tags are processed in circulation notes
No errors
Comment 15 Katrin Fischer 2020-03-22 17:52:25 UTC
Created attachment 101386 [details] [review]
Bug 23409: show borrowernotes and opacnote's lines feeds

Test plan:
  - Fill borrowernotes and opacnote with lines separated by lines
    endings,
  - save and check the content is displayed on a single line,
  - apply this patch,
  - check lines endings are displayed

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 16 Katrin Fischer 2020-03-22 17:52:28 UTC
Created attachment 101387 [details] [review]
Bug 23409: (follow-up) Allow HTML in circulation note and add line breaks in OPAC user account

This patch makes 2 changes:
- bug 22702 allowed adding HTML to the circulation note, so this patch
  restores that ability.
- display OPAC note and messages as multi-line in OPAC

To test:
- Add a circulation and an OPAC note with line breaks and HTML tags
  to the patron account
- Add a message with line breaks to the patron account
- Check line breaks don't show on
  - OPAC > patron account > my summary page
  - Staff > patron account > details
- Apply patches
- Repeat test

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Notes and messages show line breaks in OPAC, Notes on staff
HTML tags are processed in circulation notes
No errors

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 17 Martin Renvoize 2020-03-24 11:05:15 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 18 Joy Nelson 2020-04-03 21:44:46 UTC
Backported to 19.11.x for 19.11.05
Comment 19 Lucas Gass 2020-04-13 20:33:15 UTC
not backporting enchancment to 19.05.x