Problem / Motivation

If you are rendering entities in a search index, you may see this error on index:

InvalidArgumentException while trying to render item (entityidhere) with view mode full for search index Acquia Search Solr Index: Route required in Drupal\Core\Url::fromRouteMatch()

The error is happening because src/EasyBreadcrumbBuilder.php calls Url::fromRouteMatch($route_match) but $route_match does not have a route object.

Proposed Resolution

Add a condition to check for the route object. If the route object does not exist, do not render a link.

Comments

josephdpurcell created an issue. See original summary.

josephdpurcell’s picture

josephdpurcell’s picture

Status: Active » Needs review

I've applied the patch and it resolves the error on index. It needs reviewed to ensure there is not adverse behavior.

greg boggs’s picture

Status: Needs review » Reviewed & tested by the community

greg boggs’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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