Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 302332

Links with query params with integer keys reset the keys

$
0
0

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

Release notes snippet


Viewing all articles
Browse latest Browse all 302332

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>