Skip to content

Fix double-encoded filter name in date range inputs#136

Open
Varlin wants to merge 1 commit into
SemanticMediaWiki:masterfrom
Varlin:patch-2
Open

Fix double-encoded filter name in date range inputs#136
Varlin wants to merge 1 commit into
SemanticMediaWiki:masterfrom
Varlin:patch-2

Conversation

@Varlin

@Varlin Varlin commented May 31, 2026

Copy link
Copy Markdown
Contributor

Issue : The filters based on datepicker range filters send wrong URLs when the date property contains special characters like accents.

Exemple : "?_lower_Date_de_d%25C3%25A8s" instead of "?_lower_Date_de_décès=2020-02-13..."

Cause : In GetApplicableFilters::getUnappliedFilterLine(), $filter_name is built with urlencode() for use in link URLs. This encoded value is also passed to getDateRangeInput(), causing the attributes to contain already-encoded characters (e.g. "Date_de_d%C3%A8s"). When the browser submits the form, it encodes them a second time (e.g. "Date_de_d%25C3%25A8s"), which no longer matches the filter name expected by SpecialBrowseData, so the date range filter has no effect.

Fix: pass the raw (non-encoded) filter name to getDateRangeInput(), just replacing white spaces with underscores.

pass the raw (non-encoded) filter name to getDateRangeInput() to avoid double encoding, which breaks URL in case of accents
@codecov

codecov Bot commented May 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 34.61%. Comparing base (1c054e5) to head (cdfd60e).

❗ There is a different number of reports uploaded between BASE (1c054e5) and HEAD (cdfd60e). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (1c054e5) HEAD (cdfd60e)
2 1
Additional details and impacted files
@@              Coverage Diff              @@
##             master     #136       +/-   ##
=============================================
- Coverage     77.70%   34.61%   -43.10%     
=============================================
  Files            36        1       -35     
  Lines          2373       52     -2321     
  Branches          7        7               
=============================================
- Hits           1844       18     -1826     
+ Misses          524       29      -495     
  Partials          5        5               

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant