Bug 40602 - Broken HTML showing in Alert 'subscriptions' tab
Summary: Broken HTML showing in Alert 'subscriptions' tab
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-08-06 11:15 UTC by Katrin Fischer
Modified: 2025-09-25 16:30 UTC (History)
3 users (show)

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


Attachments
Bug 40602: Broken HTML showing in Alert 'subscriptions' tab (1.73 KB, patch)
2025-08-25 16:38 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 40602: Broken HTML showing in Alert 'subscriptions' tab (1.76 KB, patch)
2025-09-04 15:51 UTC, Noah Tremblay
Details | Diff | Splinter Review
Bug 40602: Broken HTML showing in Alert 'subscriptions' tab (1.82 KB, patch)
2025-09-11 12:07 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 40602: Broken HTML showing in Alert 'subscriptions' tab (1.84 KB, patch)
2025-09-15 14:47 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2025-08-06 11:15:11 UTC
In the "Alert subscriptions" tab in the OPAC there is broken HTML showing on the page, maybe from a merge conflict, because it doesn't actually make sense, to display the name in that spot.

To test:
* Add a serial subscription and set a notification template
* Go to the OPAC and subscribe to the email notification for this subscription 
  (you must be logged in to see the button on the subscriptions tab)
* Go to the patron account > tab alert subscriptions
* Verify in the last column something like this shows:

 	
Frau Karin Mustermann"> X Unsubscribe from email alerts

The "Frau Karin Mustermann">" should not be there.
Comment 1 Katrin Fischer 2025-08-25 13:13:38 UTC
In order to reproduce this:
Make sure you are testing with a user, that has a salutation, surname and firstname set. 

The problem is patroninfo creating HTML tags even with the no_html flag set it looks like:

                                            <form action="/cgi-bin/koha/opac-alert-subscribe.pl" method="post" class="unsubscribe" data-title="[% sub.biblio.title | html %] [% sub.biblio.subtitle | html %]" data-patron="[% INCLUDE 'patron-title.inc' no_html=1 patron=logged_in_user%]">

Generates: 

<form action="/cgi-bin/koha/opac-alert-subscribe.pl" method="post" class="unsubscribe" data-title="Kölner Zeitschrift für Soziologie und Sozialpsychologie, " data-patron="        <span class="patron-title">Frau</span>    Karin  Mustermann">

... Which is invalid because of the "" and also there should be NO HTML tags.
Comment 3 Katrin Fischer 2025-08-25 13:25:54 UTC
I've temporarily switched to [% logged_in_user.firstname %] [% logged_in_user.surname %] which seems to avoid the issue for now. 

Just switching the " for ' leaves a broken confirmation message.

I think we need to implement a no_html flag for patron_title.inc in the OPAC to properly fix this.
Comment 4 Owen Leonard 2025-08-25 16:38:18 UTC
Created attachment 185746 [details] [review]
Bug 40602: Broken HTML showing in Alert 'subscriptions' tab

This patch adds handling of the "no-html" flag to patron-title.inc. The
OPAC alert subscriptions page passes the "no-html" flag but the include
file wasn't written to include it.

To test, apply the patch and log in to the OPAC as a user who has a
title (salutation).

- Add a serial subscription and set a notification template
- Go to the OPAC and subscribe to the email notification for this
  subscription
- Go to the patron account > Alert subscriptions tab
- Verify that the last column shows an "Unsubscribe from email alerts"
  button.
- There should be no errant HTML.

Sponsored-by: Athens County Public Libraries
Comment 5 Noah Tremblay 2025-09-04 15:51:03 UTC
Created attachment 186169 [details] [review]
Bug 40602: Broken HTML showing in Alert 'subscriptions' tab

This patch adds handling of the "no-html" flag to patron-title.inc. The
OPAC alert subscriptions page passes the "no-html" flag but the include
file wasn't written to include it.

To test, apply the patch and log in to the OPAC as a user who has a
title (salutation).

- Add a serial subscription and set a notification template
- Go to the OPAC and subscribe to the email notification for this
  subscription
- Go to the patron account > Alert subscriptions tab
- Verify that the last column shows an "Unsubscribe from email alerts"
  button.
- There should be no errant HTML.

Sponsored-by: Athens County Public Libraries
Signed-off-by: noah <noah@inlibro.com>
Comment 6 Katrin Fischer 2025-09-11 11:58:21 UTC
Hi Noah, I notice that your sign-off line is:
Signed-off-by: noah <noah@inlibro.com> 
For the dashboard and the release notes we can do a mail map to your full name, but you might also consider to change your git setting to have it in the patches themselves.
Comment 7 Katrin Fischer 2025-09-11 12:07:47 UTC
Created attachment 186372 [details] [review]
Bug 40602: Broken HTML showing in Alert 'subscriptions' tab

This patch adds handling of the "no-html" flag to patron-title.inc. The
OPAC alert subscriptions page passes the "no-html" flag but the include
file wasn't written to include it.

To test, apply the patch and log in to the OPAC as a user who has a
title (salutation).

- Add a serial subscription and set a notification template
- Go to the OPAC and subscribe to the email notification for this
  subscription
- Go to the patron account > Alert subscriptions tab
- Verify that the last column shows an "Unsubscribe from email alerts"
  button.
- There should be no errant HTML.

Sponsored-by: Athens County Public Libraries
Signed-off-by: noah <noah@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 8 Katrin Fischer 2025-09-11 12:08:23 UTC
Thanks a lot Owen!
Comment 9 Noah Tremblay 2025-09-15 14:42:35 UTC
Hi Catherine,

Sorry about that — I’ve updated my Git settings so my future sign-off lines will have my full name. Thanks for pointing it out!
Comment 10 Jonathan Druart 2025-09-15 14:47:57 UTC
Created attachment 186433 [details] [review]
Bug 40602: Broken HTML showing in Alert 'subscriptions' tab

This patch adds handling of the "no-html" flag to patron-title.inc. The
OPAC alert subscriptions page passes the "no-html" flag but the include
file wasn't written to include it.

To test, apply the patch and log in to the OPAC as a user who has a
title (salutation).

- Add a serial subscription and set a notification template
- Go to the OPAC and subscribe to the email notification for this
  subscription
- Go to the patron account > Alert subscriptions tab
- Verify that the last column shows an "Unsubscribe from email alerts"
  button.
- There should be no errant HTML.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Noah Tremblay <noah.tremblay@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 11 Lucas Gass (lukeg) 2025-09-18 19:54:12 UTC
Nice work everyone!

Pushed to main for 25.11
Comment 12 Paul Derscheid 2025-09-25 16:30:16 UTC
Nice work everyone!

Pushed to 25.05.x