[Bug 33734] New: Using custom search filters breaks scandic characters in search term
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 Bug ID: 33734 Summary: Using custom search filters breaks scandic characters in search term Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Templates Assignee: oleonard@myacpl.org Reporter: vilkunpostilaatikko@gmail.com QA Contact: testopia@bugs.koha-community.org To recreate: 1. Enable SavedSearchFilters syspref 2. Perform search with bib-level:("a") 3. Click "Save search as filter" and save 4. Perform search containing scandic character (åöä) 5. Use filter you just created => notice that scandic characters in search term displayed incorrectly e.g. ä turns to ä -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 --- Comment #1 from Owen Leonard <oleonard@myacpl.org> --- Where is the malformed text? It looks correct to me when it's shown in the sidebar in both the OPAC and the staff interface. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 --- Comment #2 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I am seeing the issue too. * Activate search filters * Search for the * Save as search filter * Search for ü * Limit to saved filter No results match your search for 'kw,wrdl: "ü"' with limit(s): 'and (the)'. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 Ville Korjus <vilkunpostilaatikko@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|oleonard@myacpl.org |vilkunpostilaatikko@gmail.c | |om Status|NEW |Needs Signoff --- Comment #3 from Ville Korjus <vilkunpostilaatikko@gmail.com> --- Created attachment 151551 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=151551&action=edit Bug 33734: Use raw filters with search filter links in facets.inc Using html filters breaks scandic characters in search term if one uses custom search filters. Use raw filters instead. To test: 1. Enable SavedSearchFilters syspref 2. Perform search with bib-level:("a") 3. Click "Save search as filter" and save 4. Perform search containing scandic character (åöä) 5. Use filter you just created => notice that scandic characters in search term are displayed incorrectly e.g. ä turns to ä 6. Apply this patch 7. Repeat steps 4 and 5 => scandic characters should now be displayed correctly Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 Sam Lau <samalau@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 Sam Lau <samalau@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #151551|0 |1 is obsolete| | --- Comment #4 from Sam Lau <samalau@gmail.com> --- Created attachment 151653 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=151653&action=edit Bug 33734: Use raw filters with search filter links in facets.inc Using html filters breaks scandic characters in search term if one uses custom search filters. Use raw filters instead. To test: 1. Enable SavedSearchFilters syspref 2. Perform search with bib-level:("a") 3. Click "Save search as filter" and save 4. Perform search containing scandic character (åöä) 5. Use filter you just created => notice that scandic characters in search term are displayed incorrectly e.g. ä turns to ä 6. Apply this patch 7. Repeat steps 4 and 5 => scandic characters should now be displayed correctly Sponsored-by: Koha-Suomi Oy Signed-off-by: Sam Lau <samalau@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com --- Comment #5 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- This code is wrong, we should reuse what we are doing later in the same file (search 'local_url'). Note that we are missing count and sort_by. It's not your patch that is wrong but the existing code. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #6 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- I guess the OPAC side should be fixed as well. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |17170 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17170 [Bug 17170] Add the ability to create 'saved searches' for use as filters when searching the catalog -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |emmi.takkinen@koha-suomi.fi -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 --- Comment #7 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Do you think you could have another look at this one? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |michaela.sieber@kit.edu --- Comment #8 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- *** Bug 34192 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Using custom search filters |Using custom search filters |breaks scandic characters |breaks diacritics |in search term |characters in search term -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #9 from David Cook <dcook@prosentient.com.au> --- Definitely don't want to be using the "raw" filter there. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 --- Comment #10 from David Cook <dcook@prosentient.com.au> --- (In reply to Katrin Fischer from comment #2)
I am seeing the issue too.
* Activate search filters * Search for the * Save as search filter * Search for ü * Limit to saved filter
No results match your search for 'kw,wrdl: "ü"' with limit(s): 'and (the)'.
Thanks for that plan. I confirm that it happens too. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 --- Comment #11 from David Cook <dcook@prosentient.com.au> --- (In reply to David Cook from comment #9)
Definitely don't want to be using the "raw" filter there.
Actually, I'm wrong. We do want to be using the "raw" filter here, because the URL is already encoded. However, Ville makes a couple of mistakes in their patch. First, we should escape search_filter.id for completeness even though it's system generated. Second, we need to escape search_filter.name since that is user generated and could cause XSS if it's not HTML escaped. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #151653|0 |1 is obsolete| | --- Comment #12 from David Cook <dcook@prosentient.com.au> --- Created attachment 155582 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=155582&action=edit Bug 33734: Remove incorrect URL escaping on search filters This patch removes an incorrect URL escaping on search filter facet URLs. Without this patch, search filters using non-ASCII characters won't return results. To test: 0. Apply patch 1. Enable SavedSearchFilters syspref 2. Search for "the" 3. Save as search filter 4. Search for "ü" 5. Apply the "the" filter 6. Note that search results appear -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |minor Assignee|vilkunpostilaatikko@gmail.c |dcook@prosentient.com.au |om | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 PTFS Europe Sandboxes <sandboxes@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #155582|0 |1 is obsolete| | --- Comment #13 from PTFS Europe Sandboxes <sandboxes@ptfs-europe.com> --- Created attachment 155583 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=155583&action=edit Bug 33734: Remove incorrect URL escaping on search filters This patch removes an incorrect URL escaping on search filter facet URLs. Without this patch, search filters using non-ASCII characters won't return results. To test: 0. Apply patch 1. Enable SavedSearchFilters syspref 2. Search for "the" 3. Save as search filter 4. Search for "ü" 5. Apply the "the" filter 6. Note that search results appear Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 Michaela Sieber <michaela.sieber@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #14 from Michaela Sieber <michaela.sieber@kit.edu> --- Great, thanks David :-) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #15 from David Cook <dcook@prosentient.com.au> --- (In reply to Michaela Sieber from comment #14)
Great, thanks David :-)
Thanks, Michaela! Although I just realized I forgot to fix the OPAC, so I need to mark it as Failed QA... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #155583|0 |1 is obsolete| | --- Comment #16 from David Cook <dcook@prosentient.com.au> --- Created attachment 155584 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=155584&action=edit Bug 33734: Remove incorrect URL escaping on search filters This patch removes an incorrect URL escaping on search filter facet URLs. Without this patch, search filters using non-ASCII characters won't return results. To test: 0. Apply patch 1. Enable SavedSearchFilters syspref 2. Search for "the" 3. Save as search filter (to show on both OPAC and staff interface) 4. Search for "ü" in staff interface 5. Apply the "the" filter 6. Note that search results appear 7. Search for "ü" in OPAC 8. Apply the "the" filter 9. Note that search results appear -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 --- Comment #17 from David Cook <dcook@prosentient.com.au> --- (In reply to Michaela Sieber from comment #14)
Great, thanks David :-)
If you want to test again now, that would be great! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 PTFS Europe Sandboxes <sandboxes@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #155584|0 |1 is obsolete| | --- Comment #18 from PTFS Europe Sandboxes <sandboxes@ptfs-europe.com> --- Created attachment 155585 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=155585&action=edit Bug 33734: Remove incorrect URL escaping on search filters This patch removes an incorrect URL escaping on search filter facet URLs. Without this patch, search filters using non-ASCII characters won't return results. To test: 0. Apply patch 1. Enable SavedSearchFilters syspref 2. Search for "the" 3. Save as search filter (to show on both OPAC and staff interface) 4. Search for "ü" in staff interface 5. Apply the "the" filter 6. Note that search results appear 7. Search for "ü" in OPAC 8. Apply the "the" filter 9. Note that search results appear Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 Michaela Sieber <michaela.sieber@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |katrin.fischer@bsz-bw.de |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #155585|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #155584|1 |0 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #155584|0 |1 is obsolete| | --- Comment #19 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 155690 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=155690&action=edit Bug 33734: Remove incorrect URL escaping on search filters This patch removes an incorrect URL escaping on search filter facet URLs. Without this patch, search filters using non-ASCII characters won't return results. To test: 0. Apply patch 1. Enable SavedSearchFilters syspref 2. Search for "the" 3. Save as search filter (to show on both OPAC and staff interface) 4. Search for "ü" in staff interface 5. Apply the "the" filter 6. Note that search results appear 7. Search for "ü" in OPAC 8. Apply the "the" filter 9. Note that search results appear Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |23.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 --- Comment #20 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #21 from Fridolin Somers <fridolin.somers@biblibre.com> --- In my opinion we could have used a more simple syntaxe : <a href="[% base_url | $raw %]&nolimit=search_filter:[% search_filter.id | uri %]">[x]</a> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable Version(s)|23.11.00 |23.11.00,23.05.04 released in| | --- Comment #22 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.05.x for 23.05.04 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 --- Comment #23 from David Cook <dcook@prosentient.com.au> --- (In reply to Fridolin Somers from comment #21)
In my opinion we could have used a more simple syntaxe : <a href="[% base_url | $raw %]&nolimit=search_filter:[% search_filter.id | uri %]">[x]</a>
Yep that's true. Looking at it again, that's obvious now. "I missed the forest for the trees" 😬. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable Version(s)|23.11.00,23.05.04 |23.11.00,23.05.04,22.11.11 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33734 --- Comment #24 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Nice work everyone! Pushed to oldstable for 22.11.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org