Problem/Motivation
Using the link field with a link like this: /my-page?myparam[2021]=2021 when printed looks like this: /my-page?myparam[0]=2021&myparam[1]=2021
This is a problem when you try to add links to filtered views because even though the filters get applied, the boxes don't get checked.
Steps to reproduce
- Create a link field
- Point to an internal view page with filters in the url like: /my-page?myparam[2021]=2021
Expected behavior
- Link will be printed as entered
Current behavior
- Link gets printed like this: /my-page?myparam[0]=2021&myparam[1]=2021
Proposed resolution
Issue seems to be in line https://git.drupalcode.org/project/drupal/-/blob/9.2.x/core/lib/Drupal/C... that gets the options wicked up.
If we change that line to
$options = NestedArray::mergeDeepArray([$element['#url']->getOptions(), $element['#options']], TRUE);
it will work, but I'm unsure of the underlying effects of this.
Remaining tasks
- Analyze proposed solution
- Create patch and commit
User interface changes
None
API changes
None
Data model changes
None