Breadcrumbs does not exist sometimes.

Created on 1 May 2024, 8 months ago
Updated 10 May 2024, 8 months ago

Problem/Motivation

For some reason the 'breadcrumb' key is sometimes not in $vars in the preprocess breadcrumb hook.

The error shows up as a warning on the site.

Warning
: foreach() argument must be of type array|object, null given in
/var/www/html/docroot/modules/contrib/html_title/html_title.module
on line
88

Steps to reproduce

I'm trying to use Breadcrumbs with facetted search connected to solr and the error shows up when there's no search parameters.

  • Drupal 10.2.5
  • PHP 8.3
  • Search API 1.34

Proposed resolution

Add a simple check for the 'breadcrumb' keys in the $vars array in the preprocess_breadcrumb hook.

Remaining tasks

Review.

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States dmlb2000 Richland Washington

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