- 🇪🇸Spain pcambra Asturies
I've found this bug on a site today and patch in #4 works great.
- Status changed to Needs work
11 months ago 6:25pm 16 January 2024 The Needs Review Queue Bot → tested this issue.
While you are making the above changes, we recommend that you convert this patch to a merge request → . Merge requests are preferred over patches. Be sure to hide the old patch files as well. (Converting an issue to a merge request without other contributions to the issue will not receive credit.)
- First commit to issue fork.
- 🇮🇳India arisen Goa
The patch in #4 resolves the issue. Created a MR.
mergeDeep
is internally usingmergeDeepArray
with preserve integer keys set to FALSE by default.
In the patch we are passing it as TRUE to keep the keys as it is. Should be fine IMO.This might need some tests.
- 🇪🇸Spain pcambra Asturies
@arisen seems you've created the branch but not the actual MR?
- Status changed to Needs review
11 months ago 4:28pm 17 January 2024 - 🇮🇳India arisen Goa
What would be the ideal place to add a Kernel Test for this?
/** * Test Link element with integer key parameters */ public function testLinkWithIntegerKeyParams() { $link_array = [ '#type' => 'link', '#title' => 'foo', '#url' => Url::fromUri('internal:/my-page?myparam[2021]=2021'), ]; $link_rendered = (string) \Drupal::service('renderer')->renderRoot($link_array); $expected_link = '<a href="/my-page?myparam%5B2021%5D=2021">foo</a>'; $this->assertSame($expected_link, $link_rendered); }
Wondering if it can added as part of
core/modules/system/tests/src/Kernel/Common/UrlTest.php
orcore/tests/Drupal/KernelTests/Core/Render/Element/RenderElementTypesTest.php
- Status changed to Needs work
11 months ago 3:15pm 24 January 2024 - Status changed to Needs review
11 months ago 9:09am 29 January 2024 - Status changed to Needs work
11 months ago 8:30pm 30 January 2024 - 🇺🇸United States smustgrave
Ran the test only feature and it seemed to pass without the fix https://git.drupalcode.org/issue/drupal-3191456/-/jobs/707698 so not testing what we think it is. While updating please add :void to any new test function.
- Status changed to Needs review
11 months ago 12:57pm 1 February 2024 - 🇮🇳India arisen Goa
@smustgrave The issue is no longer reproducible on D11 but still existing on D10(checked on 10.2.2).
Seems like
NestedArray::mergeDeep
was not the root cause.
Looks like there has been some changes to the link preprocessing logic.$options = NestedArray::mergeDeep($element['#url']->getOptions(), $element['#options']);
On D11, is an empty array so the issue is no longer occurring, whereas on D10 its having the params info same as $element['#url']->getOptions(). - Status changed to Needs work
11 months ago 1:33pm 1 February 2024 - 🇺🇸United States smustgrave
Then think we need some research about what issue was committed to 11 that didn’t get backported to 10 that fixed this issue.
- Status changed to Needs review
11 months ago 2:10pm 1 February 2024 - 🇮🇳India arisen Goa
@smustgrave found the issue 🐛 Query string duplications Fixed
It's already been added to 10.2 also. - Status changed to Closed: duplicate
11 months ago 2:14pm 1 February 2024 - 🇺🇸United States smustgrave
Note the related issue was merged 2 days ago so not in a tagged release yet