InvalidArgumentException

Created on 28 February 2024, 9 months ago
Updated 20 August 2024, 3 months ago

Problem/Motivation

There are some situations in which the module returns the following error:

InvalidArgumentException: Route required in Drupal\Core\Url::fromRouteMatch() (line 170 of core/lib/Drupal/Core/Url.php).

Steps to reproduce

It happens with routes that does not respond to an object (entity, view, ...), but for some reason is yet valid. In my case, it happens when I type /sitemap in the URL.

Proposed resolution

Add an additonal validation to test if the route match is a valid route object. I attach a patch with the proposed solution.

🐛 Bug report
Status

Active

Version

2.1

Component

Code

Created by

🇪🇸Spain dtamajon

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