Bug 40860 - ILL get_notice does not consider HTML template notices
Summary: ILL get_notice does not consider HTML template notices
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: ILL (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-09-23 10:59 UTC by Pedro Amorim
Modified: 2025-09-23 11:09 UTC (History)
3 users (show)

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


Attachments
Bug 40860: Consider is_html template notice (4.13 KB, patch)
2025-09-23 11:04 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 40860: Consider is_html template notice (3.80 KB, patch)
2025-09-23 11:09 UTC, Pedro Amorim
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro Amorim 2025-09-23 10:59:45 UTC
ill_full_metadata => $metastring has the attributes joined by a "\n". This does not work if the notice is an HTML notice. For HTML notice, a '<br>' needs to be used instead.
Comment 1 Pedro Amorim 2025-09-23 11:04:35 UTC Comment hidden (obsolete)
Comment 2 Pedro Amorim 2025-09-23 11:09:49 UTC
Created attachment 186788 [details] [review]
Bug 40860: Consider is_html template notice

Change logic of get_notice to fetch the template before GetPreparedLetter.
This allows to verify is the template is HTML or not, and act accordingly.

Test plan, before applying patch:

1) Enable ILLModule
2) Edit the default ktd ILL partner patron and add a primary email address:
   <staff_url>/cgi-bin/koha/circ/circulation.pl?borrowernumber=16
3) Create a new ILL request, visit:
   <staff_url>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
4) Add some metadata like title and author, after creation click 'Place request with partners'. 'FRL - Walker' should show up as an option. Select that and click 'Send email'.
5) Run the following query to grab the produced email content:
$ koha-mysql kohadev
$ SELECT content FROM message_queue;
6) Utilize an HTML previewer (to avoid having to send the mail for testing):
https://html.onlineviewer.net/
7) Paste the contents there, notice there's no line breaks when shown as HTML.
8) Apply patch, restart plack, repeat test plan. Notice the HTML preview has appropriate line breaks for each metadata entry. Please note that any other remaining line breaks need to replaced by a <p> tag but that is besides the ill_full_metadata substitution scope of this patch.