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 ä
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.
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)'.
Created attachment 151551 [details] [review] 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
Created attachment 151653 [details] [review] 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>
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.
I guess the OPAC side should be fixed as well.
Do you think you could have another look at this one?
*** Bug 34192 has been marked as a duplicate of this bug. ***
Definitely don't want to be using the "raw" filter there.
(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.
(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.
Created attachment 155582 [details] [review] 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
Created attachment 155583 [details] [review] 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>
Great, thanks David :-)
(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...
Created attachment 155584 [details] [review] 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
(In reply to Michaela Sieber from comment #14) > Great, thanks David :-) If you want to test again now, that would be great!
Created attachment 155585 [details] [review] 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>
Created attachment 155690 [details] [review] 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>
Pushed to master for 23.11. Nice work everyone, thanks!
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>
Pushed to 23.05.x for 23.05.04
(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" [U+1F62C].
Nice work everyone! Pushed to oldstable for 22.11.x