Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
The Url class may be used in a context where you need the query string and fragment generated separately from the path or URL.
Add a helper method to support this, e.g. for \Drupal\menu_link_content\Form\MenuLinkContentForm
Comment | File | Size | Author |
---|---|---|---|
#7 | add_a_helper_method_to-2305013-7.patch | 2.68 KB | marvil07 |
Comments
Comment #1
YesCT CreditAttribution: YesCT commentedmaking child of the homestretch meta
Comment #2
dawehnerIt seems to be useful to put this into the url generator first.
Comment #3
dawehnerHere is one.
Comment #7
marvil07 CreditAttribution: marvil07 commentedMinor reroll(context around hunks changed).
Comment #9
dawehnerGiven that this is independent from routing, should we maybe add that rather to the UrlHelper class?
Comment #10
Wim Leers+1
We already have
\Drupal\Component\Utility\UrlHelper::buildQuery()
there.OTOH: we do allow users to enter
?foo=bar
when creating a menu item. This is stored asinternal:?foo=bar
, but renders to an empty URL (i.e. the empty string).Comment #11
dawehnerWell yeah ideally there would maybe a helper method on both the url assembler and url generator which simply strips of the path.
Wait the menu system has bugs, I DON'T THINK SO ;)
Comment #12
Wim Leers#2351015: URL generation does not bubble cache contexts introduced this.
outputs
Comment #13
dawehnerLovely, indeed!