Problem/Motivation

opigno_learning_path\LearningPathAccess has code like the following:

      $token = \Drupal::moduleHandler()->moduleExists('token') ? TRUE : FALSE;
      LearningPathAccess::notifyUsersByMail($group, $uid, $status, $token);

...


 public static function replaceGroupUserTokens(&$text, $params, $token) {
    if ($token) {
      $text = \Drupal::token()->replace($text);

However, Drupal::token() is always available with Drupal core. Token module in contrib only provides additional tokens and the browser UI.

Steps to reproduce

Proposed resolution

Always call Drupal::token()->replace() and remove the moduleExists() checks

Remaining tasks

User interface changes

API changes

Data model changes

Comments

catch created an issue. See original summary.

dipayanpramanik5’s picture

Assigned: Unassigned » dipayanpramanik5
dipayanpramanik5’s picture

Assigned: dipayanpramanik5 » Unassigned
Status: Active » Needs review
StatusFileSize
new2.56 KB
axelm’s picture

Hi
Thanks for reporting this and suggesting some patch,
We will include a fix in the next Opigno release.

axelm’s picture

Status: Needs review » Patch (to be ported)
axelm’s picture

Released in Opigno 3.1.0

axelm’s picture

Status: Patch (to be ported) » Fixed
axelm’s picture

Status: Fixed » Closed (fixed)