Error: Call to undefined method Drupal\burndown\Controller\SprintController::l()

Created on 3 December 2024, about 1 month ago

Problem/Motivation

After making a revision of a project type and then saving it. By pressing the revision tab, the following error appears.

The website encountered an unexpected error. Try again later.

Error: Call to undefined method Drupal\burndown\Controller\SprintController::l() in Drupal\burndown\Controller\SprintController->revisionOverview() (line 121 of modules/contrib/burndown/src/Controller/SprintController.php).

The following method is being called.

          $link = $this->l($date, new Url('entity.burndown_sprint.revision', [
            'burndown_sprint' => $burndown_sprint->id(),
            'burndown_sprint_revision' => $vid,
          ]));

Possible solution.

https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Link.php/...

use Drupal\Component\Utility\Xss;
use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\Core\Url;
use Drupal\Core\Link; <---- added this class
use Symfony\Component\DependencyInjection\ContainerInterface;


        if ($vid != $burndown_sprint->getRevisionId()) {
          $link = Link::fromTextAndUrl($date, new Url('entity.burndown_sprint.revision', [
            'burndown_sprint' => $burndown_sprint->id(),
            'burndown_sprint_revision' => $vid,
          ]))->toString();
        }

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇦🇺Australia purencool

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024