Problem/Motivation

#2605546: Mark \Drupal::url() as deprecated has marked Drupal::url() as deprecated. All calls should be replaced with namespaced usage of \Drupal\Core\Url

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Task
Issue priority Normal because it's just about code cleanup and good practices
Prioritized changes The main goal of this issue is DX, performance and removing code already deprecated for 8.0.0.
Disruption This change is not disruptive at all as it only replaces deprecated functions call by their exact equivalent.

Proposed resolution

For every subtask (see sidebar for the list of subtasks), search for Drupal::url() calls in component/module folder(s).
Replace the deprecated call to Drupal::url() with direct usage of \Drupal\Core\Url.

Remaining tasks

  • Create subtasks for specific components
  • Fix subtasks
  • Check the entire codebase for remaining calls to Drupal::url()

User interface changes

None.

API changes

None.

Comments

valthebald created an issue. See original summary.

valthebald’s picture

Issue summary: View changes
ifrik’s picture

This also needs to be change on documentation pages on drupal.org such as #2869035: Replace Drupal::url in Help Text Standards

catch’s picture

Let's consolidate all the hook_help() changes into a single issue. See https://www.drupal.org/core/scope for some advice on patch scope.

We could maybe have one more issue to do all the non-hook_help() calls.

Also thanks ifrik for opening the docs issue, let's do that sooner rather than later.

dawehner’s picture

I am not convinced that we should have one issue per module. Personally I believe having one issue to convert them all would be a better approach.

dawehner’s picture

So yeah maybe all hook_help(), one for tests and all the others?

xjm’s picture

Yeah, agreed with @catch and @dawehner. All those child issues should be closed as duplicates of this one.

See https://www.drupal.org/core/scope#files for why per-module issues are not used.

sahilsharma011’s picture

@xjm I am closing all the other issues related to this issue as duplicates and I am creating a generic issue for all other modules

sahilsharma011’s picture

Closed all the issues related to modules. If someone wants to provide a patch, they would've to provide a single patch for all the modules.
Refer : https://www.drupal.org/node/2869074

mpdonadio’s picture

Should probably also add a @trigger_error w/ the deprecation notice, too, if we are removing everything.

dawehner’s picture

Should probably also add a @trigger_error w/ the deprecation notice, too, if we are removing everything.

I guess a good longterm strategy would be to have a postponed issue for all those meta issues which would be triggered once we have converted all the instances ...

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

bserem’s picture

Issue summary: View changes

I changed "direct usage" to "namespaced usage" in the issue description, so as to follow coding standards.

xjm’s picture

Status: Active » Closed (duplicate)

Closing as a duplicate of #2869074: [meta] Replace all calls of the deprecated Drupal::url() from all the modules of Drupal Core where the work is currently happening. Thanks!