Bug 35772

Summary: Double escaping of patron fields in bookings modal
Product: Koha Reporter: Martin Renvoize (ashimema) <martin.renvoize>
Component: Staff interfaceAssignee: Jonathan Druart <jonathan.druart>
Status: RESOLVED FIXED QA Contact: Kyle M Hall (khall) <kyle>
Severity: normal    
Priority: P5 - low CC: david, fridolin.somers, gmcharlt, kyle, lucas
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00,23.11.02
Circulation function:
Bug Depends on: 29002    
Bug Blocks:    
Attachments: Bug 35772: Remove double escaping
Bug 35772: Remove double escaping
Bug 35772: Remove double escaping

Description Martin Renvoize (ashimema) 2024-01-11 11:18:40 UTC
Jonathan reported:

If a patron has HTML character in surname or firstname, Select2 will escapeHtml twice.
To recreate edit a patron, set firstname: <span>test</span>
Place booking, search for test
It shows correctly in the result, but when you select it you will see "&lt;", etc.
Comment 1 Martin Renvoize (ashimema) 2024-01-11 11:21:54 UTC
Created attachment 160832 [details] [review]
Bug 35772: Remove double escaping

Patch as proposed by Jonathan in a comment on bug 29002
Comment 2 David Nind 2024-01-12 07:08:18 UTC
Created attachment 160895 [details] [review]
Bug 35772: Remove double escaping

Patch as proposed by Jonathan in a comment on bug 29002

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2024-01-12 07:18:53 UTC
Testing notes (using KTD):

1. Replicated the issue as per comment #1
2. Applied the patch.
3. Repeated step 1.
4. Name now displays (with HTML code shown).

Note: IN KTD I had to set DefaultPatronSearchMethod to 'Contains', otherwise searching for Test didn't return any autocomplete results.
Comment 4 Kyle M Hall (khall) 2024-01-12 13:54:53 UTC
Created attachment 160965 [details] [review]
Bug 35772: Remove double escaping

Patch as proposed by Jonathan in a comment on bug 29002

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 5 Katrin Fischer 2024-01-16 10:11:09 UTC
Please include test plan in commits ;) I added one in RM step.
Comment 6 Katrin Fischer 2024-01-16 11:09:50 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 7 Fridolin Somers 2024-01-17 09:32:00 UTC
Pushed to 23.11.x for 23.11.02