- Issue created by @Anybody
- 🇨🇦Canada boquistm
I had the same issue where I was trying to set initial exposed filter value for a view as a URL query parameter. In my case, the query parameter in URL needed to be an array. So adding square brackets after type: https://www.example.com/index.php?type[]=xyz might help you.
- Status changed to Needs work
5 months ago 6:21am 22 July 2024 - 🇩🇪Germany Anybody Porta Westfalica
Thanks @boquistm.
The problem is, that we can't do anything about these URL values, as they are request parameters. So we'd need the views exposed form to filter them and only handle the ones we expect.I think this is the line where the errors starts:
https://git.drupalcode.org/project/drupal/-/blob/11.x/core/lib/Drupal/Co...Maybe we'd need to use "setProgrammed()" on FormState, but I'm still quite unsure about that. I'll add a MR doing that and I already tried: It removes the issue and the exposed filter block still works as expected in my case. Still it may have unwanted side effects.
We'll need to investigate further, if that's the right way.
Furthermore, I'm not even sure if we should really always process the exposed form when just displaying it. It may depend on the case used and could be a configuration option?
- Status changed to Postponed
5 months ago 8:11am 22 July 2024 - 🇩🇪Germany Anybody Porta Westfalica
Okay I was now able to reproduce this issue without this module in Drupal core, by submitting the exposed filter on the views page directly. So I created a Drupal Core issue: 🐛 Views exposed form doesn't handle non-array values correctly, where an array is expected ("Allow multiple selections") Active
I guess it needs to be solved upstream. Any ideas?