Needs work
Project:
Drupal core
Version:
main
Component:
base system
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
14 Feb 2018 at 16:37 UTC
Updated:
11 Jul 2025 at 17:30 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
tedbowFirst try
Comment #3
tedbowComment #4
borisson_I think this is a good improvement. I think that this does make the DX better. But as you said, this needs tests.
Comment #5
dawehnerInstead of having one method with an optional parameter I think it would be a bit nicer to have two:
$this->setDestinationand$this->setCurrentDestination. This way it is way more obvious what is going on.What about using
$url->mergeOptionsfor that bit?Comment #6
tedbow@dawehner yep those sound good.
Comment #7
dawehnerThat's much nicer!
Comment #8
borisson_Needs work so we can add the tests.
Comment #21
prashant.cWas looking for the generic methods for the same. I have raised an MR with some additional checks, like the path should be internal only. Once this is reviewed, we can go ahead with writing tests also.
Current changes need to be reviewed
Comment #22
smustgrave commentedSeems to have pipeline failures. May be worth converting a spot where this is needed to help show why it should be added.
Comment #23
prashant.cComment #24
smustgrave commentedTest coverage is good, but I mean where in core could this be needed? Typically I see that functions that aren't called anywhere in core get deprecated and removed. So think we need least a spot or two in core where this is needed.
Comment #25
prashant.cI just did a keyword search in the codebase, and a few files in which this could be used are:
There could be many more like these.
Comment #26
smustgrave commentedDon't have to convert all but a few help show usefulness
Comment #27
prashant.cWas trying to find occurences of
and
$url->setOption('query', ['destination' => 'other/path'), could only find one, pushed that change.Tests were added, so I am removing the tag for now.
Comment #28
smustgrave commentedLeft some comments.
But proposed solution mentions just 1 method. If there's only 1 instance in core that could use it is this fully needed? If so will also require a CR.
Comment #29
jaypanIt's an API helper function that can be used by developers. I often need to set the destination on URLs.
Comment #30
moshe weitzman commentedI agree that this is valuable beyond just core. Today I need it for drush site:install - https://github.com/drush-ops/drush/issues/6310.