Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
We need proper replacements for the following code pieces:
url(NULL, ['absolute' => TRUE]);
url(current_path());
Proposed resolution
Remaining tasks
User interface changes
API changes
Comment | File | Size | Author |
---|---|---|---|
#9 | interdiff.txt | 1.28 KB | tim.plunkett |
#9 | current-2344487-9.patch | 12.23 KB | tim.plunkett |
#7 | interdiff.txt | 0 bytes | dawehner |
#7 | current-2344487-7.patch | 12.96 KB | dawehner |
#5 | current-2344487-5.patch | 9.61 KB | dawehner |
Comments
Comment #1
dawehnerThere we go.
Comment #2
dawehnerIt was not intended to left in the prove that I tested it.
Comment #3
tim.plunkettLets do one conversion each.
Comment #4
Wim LeersWouldn't the empty string be more logical to return?
NULL
violates the interface ofprocessOutbound()
, which says to return the processed path, and paths must be strings.(Plus, it is cast to a string anyway when used, so better to do that right away.)
I'm also reviewing this from the perspective of fixing #2335661: Outbound path & route processors must specify cacheability metadata, which will require path processors to indicate the cacheability of their alterations. If one of the path processors returns NULL instead of a string, that'll be more difficult to solve.
Comment #5
dawehnerStarted with some integration tests.
Comment #6
tim.plunkettI think the new tests look good. Just remove these.
Wasn't that supposed to be
return '';
Comment #7
dawehnerAdded a second integration test. I think this is ready to fly.
Comment #8
tim.plunkettWhy do these need the config factory?
Still need to kill this
Comment #9
tim.plunkettYou know, that's easy enough I can just do it and RTBC. I think @dawehner is traveling today.
Comment #10
xjmThis will block #2343669: Remove _l() and _url(), so bumping to critical.
Do we have a followup somewhere to remove
current_path()
?Comment #11
xjmComment #12
tim.plunkettOpened #2345753: Remove url(current_path()) and url(NULL) with <current> and <none>.
Comment #13
webchickCommitted and pushed to 8.x. Thanks!
Comment #15
Wim LeersWonderful! Now let's do #2346103: Convert url() and l() invocations using current_path() and '' to actually use them.