"Call to a member function label() on null"

Created on 5 March 2019, over 5 years ago
Updated 31 August 2023, 10 months ago

When generating facet options from terms, the Core View Facets module attempts to pull the label and display the option without checking to see if the term exists. When the term has been deleted, it generated an error along the lines of:

Error": Call to a member function label() on null" in Drupal\\core_views_facets\\Plugin\\facets\\processor\\exposed_filter_type\\Term->processDatabaseRow()" (line 52 of /var/www/drupal-eclkc/web/modules/contrib/core_views_facets/src/Plugin/facets/processor/exposed_filter_type/Term.php") @backtrace_string.
type: php
severity: error
location: https://eclkc.ohs.acf.hhs.gov/es/browse/keyword/nutricion-infantil?type=567
backtrace: #0 /var/www/drupal-eclkc/web/modules/contrib/core_views_facets/src/Plugin/facets/facet_source/CoreViewsExposedFilter.php(161): Drupal\core_views_facets\Plugin\facets\processor\exposed_filter_type\Term->processDatabaseRow(Object(stdClass)\, Object(Drupal\taxonomy\Plugin\views\filter\TaxonomyIndexTid)\, Object(Drupal\facets\Entity\Facet))
#1 /var/www/drupal-eclkc/web/modules/contrib/facets/src/FacetManager/DefaultFacetManager.php(370): Drupal\core_views_facets\Plugin\facets\facet_source\CoreViewsExposedFilter->fillFacetsWithResults(Array)
#2 /var/www/drupal-eclkc/web/modules/contrib/facets/src/FacetManager/DefaultFacetManager.php(184): Drupal\facets\FacetManager\DefaultFacetManager->updateResults('core_views_expo...')
#3 /var/www/drupal-eclkc/web/modules/contrib/facets/src/FacetManager/DefaultFacetManager.php(270): Drupal\facets\FacetManager\DefaultFacetManager->processFacets('core_views_expo...')

The following patch fixes this issue.

πŸ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States emanaton

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024