Views summary template code errors when built-in search indexes via drush core:cron

Created on 15 January 2024, 10 months ago

Problem/Motivation

When using the built-in search module and indexing a page with a views_summary via drush core:cron the cron job fails and the logs shows "InvalidArgumentException: Route required in Drupal\Core\Url::fromRouteMatch()". This seems to be because in "template_preprocess_views_view_summary" an array of active urls are set using the route that does not exists as the code is run as cli.

Steps to reproduce

Add a summary view on a page that is being indexed

Proposed resolution

The active urls section of the function should take in consideration that it is possible to be called with no route, and therefor either set
the $active_urls to an empty array when PHP_SAPI is cli , or if there is some of these that works set those instead. For our use case it seems it would be enough to set the $active_urls empty when in cli mode but I am not sure if there is some implications I am missing.

πŸ› Bug report
Status

Active

Version

10.2 ✨

Component
ViewsΒ  β†’

Last updated about 19 hours ago

Created by

πŸ‡ΈπŸ‡ͺSweden VAnnergard

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

Comments & Activities

Production build 0.71.5 2024