Closed (fixed)
Project:
Open ReadSpeaker
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Nov 2021 at 08:05 UTC
Updated:
7 Dec 2021 at 10:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
joshahubbers commentedThis patch fixes it.
Only thing is that if there are no query parameters, there is still a '?' added to the url. I could not fix this nicely. Replacing the empty array with null will generate a parameter '?0'.
Comment #3
joshahubbers commentedComment #6
sunlix@JoshaHubbers
thank a lot for your elaboration.
I have added an issue-fork and opened a merge-request. Can check the change?
Proposed resolution
replace
with
\Drupal::request()->query->all()already return a key/value based array. No need to wrap that into another array.My bad. I misread the documentation on
Drupal\Core\Url:-)By that change the Drupal internals handles empty arrays correctly so no unnessercary
?is added.Comment #7
sunlixComment #9
sunlixComment #10
joshahubbers commentedSorry for my late reaction, but thanx for your fast fix. ;-)
I wrapped \Drupal::request()->query->all() in [] because I was not entirely shure this would work if there were no parameters present. But I suppose you tested that case ;-).