Not catching properly InvalidArgumentException in matchPaths

Created on 20 December 2024, 4 months ago

Problem/Motivation

When indexing the site, probably because some unrelated error to Custom Breadcrumbs, I've seen there is an Exception that is not being catched in BreadcrumbBuilder::matchPaths.

Steps to reproduce

I was unable to find how to do it in a fresh Drupal + custom breadcrumbs installation.

Proposed resolution

Catch the InvalidArgumentException and return FALSE as the method returns if there is no breadcrumb.

Here is the error:

InvalidArgumentException while trying to render item entity:node/100146:en with view mode search_index for search index Site Search: Route required in Drupal\Core\Url::fromRouteMatch() (line 170 of /var/www/html/docroot/core/lib/Drupal/Core/Url.php)
🐛 Bug report
Status

Active

Version

1.1

Component

Code

Created by

🇪🇸Spain isholgueras

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

Comments & Activities

Production build 0.71.5 2024