From c47f9463471d67a257ce1df3cf0a428bb2753e41 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 25 May 2023 12:24:59 +0000 Subject: [PATCH] Bug 33780: Use TT html_line_break filter to format itemnotes This patch removes a snippet of TT code which was causing problems with translation. Putting HTML inside a TT replace() method resulted in TT code being processed for translation. To test, apply the patch and edit an item record's public note field so that it contains line breaks ("\n"). Since the notes field in the editor is a text field, you might want to update the record in the database: update items set itemnotes = "Line 1\nLine 2\n\n\n\nLine 3" where biblionumber = 228; View the bibliographic details page in the staff interface. The note in the holdings table should have the correct line breaks. If you inspect the HTML you should see that each "\n" has been replaced with "
" Signed-off-by: Lucas Gass --- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index cd48d884a0..dc0fef3516 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -591,7 +591,11 @@ [% item.materials | html %] [% END %] [% IF ( itemdata_itemnotes ) %] -
[% item.object.itemnotes.replace('\n','
') | $raw %]
+ +
+ [% item.object.itemnotes | html | html_line_break %] +
+ [% END %] [% IF itemdata_nonpublicnotes %] [% item.itemnotes_nonpublic | html %] -- 2.30.2