------ -------------------------------------------------------------------------------
  Line   src\Controller\ConfigInspectorController.php
 ------ -------------------------------------------------------------------------------
  151    Call to deprecated method l() of class Drupal\Core\Controller\ControllerBase:
         in Drupal 8.0.0 and will be removed before Drupal 9.0.0.
         Use \Drupal\Core\Link instead.
 ------ -------------------------------------------------------------------------------
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ilchovuchkov created an issue. See original summary.

  • ilchovuchkov committed ce071a3 on 8.x-1.x
    Issue #3076794 by ilchovuchkov: Replace deprecated method l() of class...
vuil’s picture

Status: Active » Fixed
idebr’s picture

Status: Fixed » Needs work

The config inspector overview now generates a an error:

Recoverable fatal error: Object of class Drupal\Core\Link could not be converted to string

\Drupal::l() returns a string, whileLink::createFromRoute() returns an object, so you have to call toString() on it to get a string. See https://www.drupal.org/node/2614344 for more information on this deprecation.

  • ilchovuchkov committed b71e477 on 8.x-1.x
    Issue #3076794 by ilchovuchkov: Add to Link::createFromRoute()->toString...
vuil’s picture

Status: Needs work » Fixed

Oh, yes. Thank you @idebr!

Update the issue solution (commit).

idebr’s picture

Status: Fixed » Needs work

This is still broken: Link::createFromRoute() takes a route name as its second argument, but it now gets a Url object. This returns a fatal error:

Object of class Drupal\Core\Url could not be converted to string

vuil’s picture

Status: Needs work » Active

  • ilchovuchkov committed 430be37 on 8.x-1.x
    Issue #3076794 by ilchovuchkov, idebr: Replace deprecated method l().
    
vuil’s picture

Status: Active » Needs review

Thank you for the emergency notice!

I committed the new update. I already checked it twice.
Please confirm by your side.
Thank you.

idebr’s picture

Status: Needs review » Needs work

Nope, still broken:

Recoverable fatal error: Object of class Drupal\Core\Link could not be converted to string

alan-ps’s picture

Status: Needs work » Needs review
FileSize
801 bytes

Hello, I noticed the same issue on my side. This patch should help :)

vuil’s picture

Assigned: vuil » Unassigned

Status: Needs review » Needs work

The last submitted patch, 12: config_inspector-rid_off_deprecated_l-3076794-12.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

idebr’s picture

Status: Needs work » Needs review
FileSize
774 bytes
1.31 KB

#12 Thanks, the patch fixes the fatal error.

Attached patch includes a revert of the commit in #9 to fix the automated tests.

  • ilchovuchkov committed 6da1eb7 on 8.x-1.x
    Issue #3076794 by ilchovuchkov, idebr, alan-ps: Replace deprecated...
vuil’s picture

Status: Needs review » Fixed

Committed! Thank you, guys.

Status: Fixed » Closed (fixed)

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

Kristen Pol’s picture

Issue tags: +Drupal 9 compatibility

Per a Slack discussion with Gábor Hojtsy regarding usage of D9 tags (Drupal 9, Drupal 9 compatibility, Drupal 9 readiness, etc.), "Drupal 9 compatibility" should be used for contributed projects that need updating and "Drupal 9" was the old tag for D8 issues before the D9 branch was ready. Doing tag cleanup here based on that discussion.

vuil’s picture