Closed (fixed)
Project:
Drupal core
Version:
8.6.x-dev
Component:
routing system
Priority:
Normal
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
23 Mar 2018 at 22:00 UTC
Updated:
20 Jul 2018 at 12:33 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
mpdonadioHere is a demo test merged with #2955690: Move Common tests in system.module to BTB because I hate running WTB now.
Comment #4
wim leersNice, thank you for the failing test! (And thanks for creating #2955690: Move Common tests in system.module to BTB too of course!)
This then adds back the solution that I developed in #2955383: List available representations in 406 responses.
Comment #5
dawehnerI think we should actually adapt the unit test and then maybe add some more test cases.
As part of that I realized that we should probably have support for nested query parameters.
Comment #6
dawehnerI removed a couple of conditions to make it a bit more readable :)
Comment #7
borisson_If I understand the code correctly, the
override-deep-query-mergetestcase tests this? In that case, it looks like this patch is ready.Comment #8
dawehnerYou are absolute 100% right here :)
Comment #9
wim leers👍
Comment #11
wim leersLooks like there's a random fail in there. It passed twice, now it failed.
That's why I made this change in #4.
Comment #12
wim leersThis is still blocking #2955383: List available representations in 406 responses.
Comment #13
wim leersI didn't want to reroll this so I could re-RTBC this. But it's such a trivial one-line change (see #11) that it should be okay.
Comment #15
wim leersThat reported failure is … very strange. Because https://www.drupal.org/pift-ci-job/965284 only lists one test run, and it was green. Small DrupalCI/d.o bug?
Comment #16
wim leersTagging API-First Initiative, because it's blocking an API-First Initiative issue.
Comment #17
alexpottLet's just change this to hardcoded stuff. The randomness here is not useful. So make it something like:
So this is just an invalid value - do we have to worry about BC because of this what happens on incorrectly entered external URLs in fields?
Comment #18
wim leers👍 Done!
If I'd add these test cases:
they'd indeed fail like this:
Ideally, I think we'd detect that we're not being given query overrides, and in that case we want to return the original query string verbatim, wrong or not. Would you agree?
Comment #19
dawehnerWait, are you @alexpott or not?
I'm wondering whether there is a legit usecase for having such weird query parameters with empty values. Technically sure, but practically? It feels no, so I would agree with you.
Comment #20
alexpottHmm... this was the one were I meant we should remove the random-ness because adding the z is pretty weird and an of itself.
Re...
:D well here the random-ness doesn't actually buy us anything - we're not testing escaping an randomMachineName()'s character set doesn't prove too much.
Re
Yes i agree.
Comment #21
dawehnerI just wanted to fix the tests but I think given that this is a problem of
\Drupal\Component\Utility\UrlHelper::parseI'm not sure this is really in scope to be fixed here.Comment #22
borisson_That looks great, I like that we removed the randomness of the test.
Comment #23
alexpottI've replace the z test with the suggestion from #17 because this also tests the re-ordering. I've run the test locally and it passes so fixing this on commit.
Committed and pushed a7fdfb6469 to 8.6.x and 9cbeaffb7e to 8.5.x. Thanks!
Comment #26
wim leersYay, this unblocked #2955383: List available representations in 406 responses!
Comment #28
alexpottThis fix has created two regressions in 8.6.x - see #2986560: UnroutedUrlAssembler sorts Query params in buildExternalUrl() and #2987114: Regression in external URLs in menu links with valueless query parameters
Hmmm.