API page: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Utility%2...

The docs say:

return Token::replace($text, $data);

But replace() is not static and calling it like that produces a warning.

The sample code should use \Drupal::token()/

Issue fork drupal-3348381

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

joachim created an issue. See original summary.

rckstr_rohan made their first commit to this issue’s fork.

rohan-sinha’s picture

Status: Active » Needs review

Read the doc and replaced Token::replace($text, $data) with \Drupal::token()/, ready to review, thanks.

joachim’s picture

Status: Needs review » Reviewed & tested by the community

Thanks!

  • larowlan committed 48438384 on 10.0.x
    Issue #3348381 by rckstr_rohan, joachim: incorrect example code in Token...

  • larowlan committed b479b25a on 10.1.x
    Issue #3348381 by rckstr_rohan, joachim: incorrect example code in Token...

  • larowlan committed 892cecb5 on 9.5.x
    Issue #3348381 by rckstr_rohan, joachim: incorrect example code in Token...
larowlan’s picture

Version: 10.1.x-dev » 9.5.x-dev
Priority: Normal » Minor
Status: Reviewed & tested by the community » Fixed

Committed to 10.1.x and backported to 10.0.x and 9.5.x

Thanks

Status: Fixed » Closed (fixed)

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