TypeError: ..\MetadataBubblingUrlGenerator::generateFromRoute(): Argument #2 ($parameters) must be of type array

Created on 15 November 2024, about 22 hours ago

Using TOC Filter in Drupal 11, I get:

TypeError: Drupal\Core\Render\MetadataBubblingUrlGenerator::generateFromRoute(): Argument #2 ($parameters) must be of type array, null given, called in /web/core/lib/Drupal/Core/Url.php on line 765 in Drupal\Core\Render\MetadataBubblingUrlGenerator->generateFromRoute() (line 104 of core/lib/Drupal/Core/Render/MetadataBubblingUrlGenerator.php).

As the error says, the call to generateFromRoute() gives error breaking node pages with TOC Filter enabled. It happens in Drupal 11.

toc_api/src/Toc.php:343.

        'url' => Url::fromRoute('<none>', NULL, [
            'fragment' => $header_id,
          ]

It should be:

        'url' => Url::fromRoute('<none>', [], [
            'fragment' => $header_id,
          ]
🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇲🇽Mexico Alan Delval

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024