Commit 2455a6a
[BUGFIX] facet URL encoding mismatch (spaces) when using urlParameterStyle=assoc
## Problem
When using `faceting.urlParameterStyle = assoc`, facet links containing spaces
in their values are rendered with an unresolved placeholder instead of the
actual filter value:
?tx_solr[filter][materials:Material 1]=###tx_solr:filter:materials:Material 1###
Values without spaces work correctly:
?tx_solr[filter][materials:Baustähle]=1
## Root Cause
In `SearchUriBuilder::buildLinkWithInMemoryCache()`, the placeholder keys for
`str_replace` are computed using `urlencode()`, which encodes spaces as `+`.
However, TYPO3's `UriBuilder` builds the URL template using `rawurlencode()`
(RFC 3986), which encodes spaces as `%20`.
The `str_replace` silently fails to find the `+`-encoded key in the
`%20`-encoded template, leaving the raw `###...###` placeholder in the output.
## Fix
Replace `urlencode()` with `rawurlencode()` in the second `$keys` computation
(the one used for the actual `str_replace` against the URL template). This
aligns the encoding with what TYPO3's `UriBuilder` produces.
The first `$keys` block (passed to `BeforeCachedVariablesAreProcessedEvent`)
is intentionally left unchanged to avoid side effects on existing event
listeners.
## Affected versions
Reproduced on EXT:solr 13.1.1 / TYPO3 13.4 with `urlParameterStyle = assoc`.
---
- Use rawurlencode (spaces → %20) to match TYPO3's UriBuilder encoding.
- urlencode encodes spaces as "+" which does not match "%20" in the URL template.
Ports: #46101 parent a9a96ef commit 2455a6a
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
340 | | - | |
| 340 | + | |
341 | 341 | | |
342 | 342 | | |
343 | 343 | | |
| |||
0 commit comments