Bug 30989 - Tags with some special characters are not encoded right
Summary: Tags with some special characters are not encoded right
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Owen Leonard
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-17 19:19 UTC by Lucas Gass (lukeg)
Modified: 2023-06-08 22:26 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes tags with special characters (such as +) so that the searching returns results when the tag is selected (from the record detail view in the OPAC and staff interface, and from the search results, tag cloud, and list pages in the OPAC).
Version(s) released in:
22.11.00, 22.05.03, 21.11.11
Circulation function:


Attachments
Bug 30989: Use uri filter where tag links are displayed (4.48 KB, patch)
2022-06-17 19:47 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 30989: Use uri filter where tag links are displayed (4.52 KB, patch)
2022-06-17 20:58 UTC, David Nind
Details | Diff | Splinter Review
Bug 30989: Use uri filter where tag links are displayed (4.58 KB, patch)
2022-06-17 21:30 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 30989: (QA follow-up) Use uri filter on staff detail page (1.65 KB, patch)
2022-06-17 21:30 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 30989:(QA follow-up) Use uri filter on OPAC tag cloud page (2.36 KB, patch)
2022-06-17 22:25 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass (lukeg) 2022-06-17 19:19:32 UTC
To recreate:

1. Turn on:  TagsEnabled.
2. Log in to the OPAC and create a tag like "LGBTQ+"
3. Add that record to a list
3. Now try  clicking on that tag from detail, results, and lists page.
4. If you click on the link for the "LGBTQ+" you will get a 'no results found page'.
5. The '+' needs to be encoded.
Comment 1 Lucas Gass (lukeg) 2022-06-17 19:47:12 UTC
Created attachment 136303 [details] [review]
Bug 30989: Use uri filter where tag links are displayed

TO test:
1. Turn on:  TagsEnabled.
2. Log in to the OPAC and create a tag like "LGBTQ+"
3. Add that record to a list
3. Now try  clicking on that tag from detail, results, and lists page.
4. If you click on the link for the "LGBTQ+" you will get a 'no results found page'.
5. Apply patch
6. Try clicking on each of the tags in detail, results, and lists. They should work now.
Comment 2 David Nind 2022-06-17 20:58:52 UTC
Created attachment 136311 [details] [review]
Bug 30989: Use uri filter where tag links are displayed

TO test:
1. Turn on:  TagsEnabled.
2. Log in to the OPAC and create a tag like "LGBTQ+"
3. Add that record to a list
3. Now try  clicking on that tag from detail, results, and lists page.
4. If you click on the link for the "LGBTQ+" you will get a 'no results found page'.
5. Apply patch
6. Try clicking on each of the tags in detail, results, and lists. They should work now.

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2022-06-17 21:02:13 UTC
Testing notes (using koha-testing-docker):

- This patch is only for the OPAC, clicking on the tag in the staff interface (from the record details page) returns no results. The tag is not shown in the search results or lists in the staff interface).
Comment 4 Katrin Fischer 2022-06-17 21:30:04 UTC
Created attachment 136313 [details] [review]
Bug 30989: Use uri filter where tag links are displayed

TO test:
1. Turn on:  TagsEnabled.
2. Log in to the OPAC and create a tag like "LGBTQ+"
3. Add that record to a list
3. Now try  clicking on that tag from detail, results, and lists page.
4. If you click on the link for the "LGBTQ+" you will get a 'no results found page'.
5. Apply patch
6. Try clicking on each of the tags in detail, results, and lists. They should work now.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Katrin Fischer 2022-06-17 21:30:09 UTC
Created attachment 136314 [details] [review]
Bug 30989: (QA follow-up) Use uri filter on staff detail page

This applies the same fix as the first patch but to the staff
interface detail page. With this fix, a tag like +++ can
be clicked and the tagged records will show.

To test:
- Tag some records in the staff interface with something like +++
- Go to the detail page of one of those recods
- Click on the tag
- Verify nothing is found
- Apply patch
- Repeat - all tagged records will show

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 David Nind 2022-06-17 22:01:12 UTC
Thanks Katrin for the follow-up so that this works in the staff interface!

I think this also needs to work from the tag cloud page in the OPAC.
Comment 7 Katrin Fischer 2022-06-17 22:25:37 UTC
Created attachment 136317 [details] [review]
Bug 30989:(QA follow-up) Use uri filter on OPAC tag cloud page

This fixes 2 links on the page:
* The tag within the 'all tags' cloud
* The tag shown in the 'your tags' table

Test plan as before: Test with a tag like +++
Comment 8 Tomás Cohen Arazi (tcohen) 2022-06-20 14:51:12 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 9 Lucas Gass (lukeg) 2022-07-13 20:43:12 UTC
Backported to 22.05.x for 22.05.03
Comment 10 Arthur Suzuki 2022-07-21 13:48:35 UTC
backported to 21.11.x for 21.11.11, thx!
Comment 11 Victor Grousset/tuxayo 2022-07-23 20:07:50 UTC
Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed.

Nothing to document, marking resolved.