- 🇩🇪Germany mrshowerman Munich
Resetting all the keys in the
#options
array isn't the best idea; some settings may get lost (see also 🐛 Add test coverage for rel and target settings Fixed ).
Since this issue is about duplicate query params, we should only reset the query part.For some reason, my push to the issue fork didn't appear in the MR, therefore uploading patch.
Leaving in NW as per #36.
41:33 41:14 Running- 🇺🇸United States dcam
We're also experiencing this issue on a site where we're putting URLs to faceted searches into link fields.
The issue summary has been updated per #36. The status is still NW because comment 13.5 hasn't been addressed yet.
- Status changed to Needs review
about 1 year ago 4:18am 25 October 2023 - last update
about 1 year ago 30,437 pass - 🇺🇸United States dcam
RE comment 13.5: 10 test cases is sort of correct. There are 10 display setting test cases that are tested for each URL:
- trim_length = NULL
- trim_length = 6
- rel = NULL
- rel = nofollow
- target = NULL
- target = _blank
- url_only = FALSE
- url_only = FALSE and url_plain = TRUE
- url_only = TRUE
- url_only = TRUEand url_plain = TRUE
So with 7 URLs there are 70 total permutations.
My solution was to remove the comment about there being 10 test cases. In the first place, the comment seems unnecessary. Secondly, it could easily get out of date if additional test cases are added. Let's leave it off.
- Status changed to Needs work
about 1 year ago 3:25pm 25 October 2023 - 🇺🇸United States smustgrave
Ran the tests only
Failed asserting that '\n <div>b3niWFPU</div>\n \n <div>\n <div><a href="?a%5B0%5D=1&a%5B1%5D=2&a%5B2%5D=1&a%5B3%5D=2">?a[]=1&a[]=2</a></div>\n <div><a href="?b%5B0%5D=1&b%5B1%5D=2&b%5B2%5D=1&b%5B3%5D=2">?b[0]=1&b[1]=2</a></div>\n <div><a href="?c%5B0%5D=1&c%5B1%5D=2&c%5B2%5D=1&c%5B3%5D=2&d=3">?c[]=1&d=3&c[]=2</a></div>\n <div><a href="?e%5Bf%5D%5Bg%5D=h">?e[f][g]=h</a></div>\n <div><a href="?i%5Bj%5Bk%5D=l">?i[j[k]]=l</a></div>\n <div><a href="?x=2">?x=1&x=2</a></div>\n <div><a href="?z%5B0%5D=2&z%5B1%5D=2">?z[0]=1&z[0]=2</a></div>\n </div>\n ' contains "<a href="?a%5B0%5D=1&a%5B1%5D=2">?a[]=1&a[]=2</a>".
Which is good.
But following the steps in the issue summary I get /?a%5B0%5D=test no matter with or without the patch. So I'm not getting the same failure as mentioned. So issue summary may need to be updated
- Status changed to Needs review
about 1 year ago 11:07pm 25 October 2023 - 🇺🇸United States dcam
@smustgrave I have updated the issue summary with some clarification. The URL in the link's
href
attribute is what will be incorrect. If you don't enter a value into the optional link title, then the URL will be printed there and it will be correct. So you'll have to inspect the link destination. Please let me know if you didn't understand this part of the issue. - last update
about 1 year ago Build Successful - Status changed to Needs work
about 1 year ago 1:00pm 26 October 2023 - 🇺🇸United States smustgrave
Sorry I wasn't clear but
/?a%5B0%5D=test
is the href value I get with or without the patch. - 🇺🇸United States dcam
I don't know what the difference is that's causing our results to differ. I'm not doing anything special. I install Drupal 11 or 10, add a Link field with the default options to articles, create an article with a link that has the URL
/?a[0]=test
, then view the node. The duplication happens on both versions 11 and 10. - Status changed to Needs review
about 1 year ago 11:49pm 29 October 2023 - 🇺🇸United States dcam
Here's a screen capture showing the bug: https://youtu.be/daWj49IyjHM. Maybe this will help.
- 🇺🇸United States smustgrave
Maybe if someone else could test it? I can't replicate the issue.
- 🇷🇺Russia zniki.ru
I confirm that issue exists in latest stable Drupal 10 version.
@smustgrave did you disable markup caching at `/admin/config/development/settings` ?Thanks a lot @mrshowerman for your comment #37.
I think we need to add comment to code base to make it clear.Thank @dcam for your changes, I think it make sense to remove number of tests.
- 🇺🇸United States aopes12
I ran into the same issue. I linked a query parameter in my menu which directs user to a selected facet and the double query parameter bug was causing two chips to display instead of one. In order to fix this I used a URL Redirect (302) which redirected to my query parameter and the double param bug did not happen. This may be a temporary solution for now but I did want to share.
- Status changed to Needs work
about 1 year ago 1:37pm 10 November 2023 The Needs Review Queue Bot → tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide → to find step-by-step guides for working with issues.
- Status changed to Needs review
about 1 year ago 3:52pm 10 November 2023 - 🇷🇺Russia zniki.ru
I accidentally added unwanted changes to MR.
Great that we have Needs Review Queue Bot.
MR updated and waiting for review. - Status changed to Needs work
about 1 year ago 3:57pm 10 November 2023 - 🇺🇸United States smustgrave
That MR is for 9.3.x and D9 is EOL. Needs to be for 11.x
- Status changed to Needs review
about 1 year ago 5:31pm 10 November 2023 - 🇷🇺Russia zniki.ru
Thanks @smustgrave
I created new branch and new MR https://git.drupalcode.org/project/drupal/-/merge_requests/5333 because I was not able to change target old MR.
Not sure if it was right move, let me know if there is better way to do it next time. - 🇺🇸United States smustgrave
nope you did it right. Hiding the patch files for clarity.
- 🇷🇺Russia zniki.ru
@borisson_ thanks for review, I made changes to MR.
MR is waiting for new review round. - Status changed to RTBC
about 1 year ago 6:52am 15 November 2023 - last update
about 1 year ago 29,261 pass, 20 fail - last update
about 1 year ago 29,261 pass, 20 fail - last update
about 1 year ago 29,261 pass, 20 fail - last update
about 1 year ago 29,261 pass, 20 fail - last update
about 1 year ago 29,261 pass, 20 fail - last update
about 1 year ago 29,261 pass, 20 fail - last update
about 1 year ago 29,261 pass, 20 fail - last update
about 1 year ago 29,261 pass, 20 fail - last update
about 1 year ago 29,261 pass, 20 fail - last update
about 1 year ago 29,261 pass, 20 fail - last update
about 1 year ago 29,261 pass, 20 fail - last update
about 1 year ago 29,261 pass, 20 fail - last update
about 1 year ago 29,261 pass, 20 fail - last update
about 1 year ago 29,260 pass, 22 fail - last update
about 1 year ago 29,261 pass, 20 fail - last update
about 1 year ago 29,261 pass, 20 fail - last update
about 1 year ago 29,261 pass, 20 fail - last update
about 1 year ago 29,261 pass, 20 fail - last update
about 1 year ago 29,261 pass, 20 fail - 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
larowlan → changed the visibility of the branch 11.x to hidden.
- 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
larowlan → changed the visibility of the branch 10.2.x to hidden.
- Status changed to Needs work
about 1 year ago 3:25am 22 December 2023 - 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
Left a couple of suggestions in the MR
Feel free to self-RTBC
- Status changed to Needs review
about 1 year ago 3:57am 22 December 2023 - 🇷🇺Russia zniki.ru
@larowlan, thanks for your suggestions, I applied one suggestion, but I still think
$options
is required. Please check comment #37. - Status changed to Needs work
12 months ago 4:51pm 24 December 2023 - 🇷🇺Russia zniki.ru
I believe tests are failling not because of changes in this MR.
I checked logs, and one time it was
Drupal\Tests\forum\Kernel\Migrate\d6\MigrateBlockTest
other time it was
Drupal\Tests\Core\DependencyInjection\YamlFileLoaderTestLooks like random fail, I rerun tests.
- Status changed to Needs review
12 months ago 8:01am 25 December 2023 - Status changed to RTBC
12 months ago 1:13am 27 December 2023 - 🇺🇸United States smustgrave
Leaning on @larowlan and @borission_ previous review. But appears feedback has been addressed and response to @larowlan for keeping $options.
- Status changed to Needs review
12 months ago 8:48pm 28 December 2023 - 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
Pushed the simplification I was advocating for in the MR thread
- Status changed to Needs work
12 months ago 5:39pm 29 December 2023 - Status changed to Needs review
12 months ago 10:10pm 8 January 2024 - Status changed to RTBC
12 months ago 8:14pm 9 January 2024 -
larowlan →
committed 7dcd798e on 10.2.x
Issue #2885351 by Nikolay Shapovalov, paulocs, clemens.tolboom, larowlan...
-
larowlan →
committed 7dcd798e on 10.2.x
-
larowlan →
committed 56e7439d on 11.x
Issue #2885351 by Nikolay Shapovalov, paulocs, clemens.tolboom, larowlan...
-
larowlan →
committed 56e7439d on 11.x
- Status changed to Fixed
11 months ago 10:50pm 30 January 2024 - 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
Committed to 11.x
As this fixes a bug and there is little risk of disruption, backported to 10.2.xAlso opened 📌 Attempt to move large parts of LinkFieldTest to a kernel test Active as I think we can unpick some of that test into kernel tests.
- 🇺🇸United States smustgrave
Closed 🐛 Links with query params with integer keys reset the keys Closed: duplicate as a dup
Automatically closed - issue fixed for 2 weeks with no activity.
- 🇺🇸United States mark_fullmer Tucson
Just calling out that the final implementation of this change, with the line
$element[$delta]['#attributes'] = $item->_attributes;
does appear to cause downstream problems for classes that extend the LinkFormatter class -- the problematic behavior mrshowerman warned of in https://www.drupal.org/project/drupal/issues/2885351#comment-14985734 🐛 Query string duplications Fixed
In the case of the Linkit contrib module, this code change does unset the rel and _target parameters, as described in 🐛 Add test coverage for rel and target settings Fixed . The contrib module can fix it on that end, but I wanted to call out, for due diligence, that this possibly could cause issues with other classes that extend the LinkFormatter class. Thanks!
- 🇺🇸United States paramnida
Thank you for making sure Drupal is secure and that bugs are fixed. I have some constructive feedback about this particular fix. Because this update breaks some theme functionality, even within Drupal core, I feel that it probably could have been included in a minor release instead of patch-level. I think better release notes and documentation were/are needed to help developers and site maintainers avoid problems. I see in other tickets 🐛 Link attributes not working after upgrading Drupal core from 10.2.2 to 10.2.3 Closed: works as designed that have spun off of this that suggested solutions 💬 Field content['#options'] missing after upgrade to core 10.2.3 Closed: works as designed have been provided, but because so many themes relied on the now-changed structure, it would have been nice if more communication could have happened before users deploy a change like this that could break things. But, it's understandable that perhaps the breakage was unforeseen or unanticipated. I wonder if the Drupal release notes could be updated with suggested remediations for this change? Not sure how to go about suggesting that, though...
- 🇷🇺Russia zniki.ru
@paramnida, thanks a lot for your feedback. Sorry that this change affects you in this way. I also don't know if it possible to update CR.
- 🇫🇷France andypost
I don't think the issue needs change record as behaviour was wrong and it's sad that someone is using wrong expectations.
Having CR for bug reports is useless cognitive load imo