Summary: | Multi-line TT comment: [%% item.object.itemnotes.replace('\n',' | ||
---|---|---|---|
Product: | Koha | Reporter: | Katrin Fischer <katrin.fischer> |
Component: | Templates | Assignee: | Owen Leonard <oleonard> |
Status: | NEW --- | QA Contact: | Katrin Fischer <katrin.fischer> |
Severity: | trivial | ||
Priority: | P5 - low | CC: | dcook, jonathan.druart, lucas |
Version: | Main | Keywords: | Academy |
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Bug 33780: Use TT html_line_break filter to format itemnotes
Bug 33780: Use TT html_line_break filter to format itemnotes |
Description
Katrin Fischer
2023-05-19 07:22:13 UTC
This line? 594 <td><div class="itemnotes">[% item.object.itemnotes.replace('\n','<br />') | $raw %]</div></td> (In reply to Katrin Fischer from comment #0) > [%% item.object.itemnotes.replace('\n',' I don't see this string anywhere but in Koha-staff-prog.pot (In reply to Owen Leonard from comment #2) > I don't see this string anywhere but in Koha-staff-prog.pot Sorry, scratch that, I was on the wrong branch Created attachment 151677 [details] [review] 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 "<br />" I am not sure this is about what was reporting Katrin. This is an improvement so I will sign-off. Will let Katrin decide if this was what she initially reported. Created attachment 151703 [details] [review] 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 "<br />" Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> The effect of the patch is different to the issue description. Note that before the patch, you could include HTML in the item note field. After the patch, the HTML is escaped. |