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.
Url::__toString() was removed from core recently, breaking devel_silent().
Comments
Comment #1
willzyx CreditAttribution: willzyx commentedI'm just thinking out loud
Simply change it in
Url::fromRoute('<current>')->toString()
is not an option because if the drupal installation is in a subfolder not work.Url::fromRoute('<current>')->getInternalPath()
might work but is deprecated.I was thinking something like
but I'm not sure whether it is the best way to handle it
Comment #2
tstoecklerNot sure about this statement, as that was the previous (implicit) behavior. So if there's a problem with it that seems like a separate issue?
Comment #3
willzyx CreditAttribution: willzyx commentedYes the statement is not entirely correct.. with the currently implementation Url::fromRoute('')->toString() doesn't work at all (even before #2416971: Remove Url::__toString() with implicit behavior) because the returned path has a leading slash (and if your site run in a subfolder the returned path is base_path + internal_path)
so we can commit the change that you suggest and only fix warnings or find a solution that makes work properly devel_silent()..
help is appreciated :)
Comment #5
willzyx CreditAttribution: willzyx commentedSince this issue is blocking the test bot and @tstoeckler in #2 was right, the suggested solution was committed as temporary solution and i opened #2448391: devel_silent() doesn't work properly