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,
          ]
CommentFileSizeAuthor
#3 toc_api-3487659.patch431 bytesabhishek_gupta1

Issue fork toc_api-3487659

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

alan delval created an issue. See original summary.

abhishek_gupta1’s picture

Assigned: Unassigned » abhishek_gupta1
abhishek_gupta1’s picture

Assigned: abhishek_gupta1 » Unassigned
Status: Active » Needs review
StatusFileSize
new431 bytes

@alan delval, I have fixed the issue and created Patch. please review it once

liam morland’s picture

Status: Needs review » Reviewed & tested by the community

This is the correct fix.

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

vladimiraus’s picture

Status: Reviewed & tested by the community » Fixed

Thank you. Committed. Cheers.

Status: Fixed » Closed (fixed)

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