Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Vinayak Kothule created an issue. See original summary.

jonathan1055’s picture

Title: Replace deprecated usage of Drupal::url » Replace deprecated usage of Drupal::url in status report
Issue summary: View changes
Status: Needs review » Needs work

Hi Vinayak Kothule,
Thanks for noticing this. I have added links to the old and new functions in the issue simmary.

Your patch needs a bit of work, though:

  1. It fails with Fatal error: Class 'Url' not found because you forgot to add use \Drupal\Core\Url; at the top.
  2. If you do add this, and the page /admin/reports/status actually returns a result, we do not actually get the required urls. This is because Url::fromRoute('entity.user.edit_form', ['user' => $user->id()]) returns an object, when previously \Drupal::url was returning the actual string.

Your patch passed because we do not actually have test coverage for the status report page yet. That is something that I might look to add in future. However, if you visit /admin/reports/status you can see the output manually.

Jonathan

Vinayak Kothule’s picture

Assigned: Unassigned » Vinayak Kothule
jonathan1055’s picture

Status: Needs work » Needs review

I have added tests to cover the status report page, on #2712465-2: 8.x test coverage. Now re-queueing the patch above, which should show the failures.

Status: Needs review » Needs work

The last submitted patch, replace-deprecated-usage-of-drupal-url.patch, failed testing.

jonathan1055’s picture

Title: Replace deprecated usage of Drupal::url in status report » Replace deprecated usage of Drupal::url in .install status report
Assigned: Vinayak Kothule » jonathan1055
Category: Bug report » Task
Status: Needs work » Needs review
FileSize
989 bytes

No response from Vinayak, so here is a new patch. I added the necessary use \Drupal\Core\Url; and both of the calls to Url::fromRoute needed ->toString()

  • jonathan1055 committed cc9325a on 8.x-1.x
    Issue #2781433 by Vinayak Kothule, jonathan1055: Replace deprecated...
jonathan1055’s picture

Assigned: jonathan1055 » Unassigned
Status: Needs review » Fixed

Committed. Thanks Vinayak for starting this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.