- Issue created by @a-fro
- Merge request !221Issue #3458558: Error: Call to a member function getAllowedBundles() on null β (Open) created by a-fro
The ListItemProcessor plugin includes the following comment and code:
// If it's an entity base field, we find it in the field definitions.
// We don't have access to the bundle via SearchApiFacetSourceInterface, so
// we check the entity's base fields only.
$base_fields = $this->entityFieldManager->getFieldDefinitions($entity, '');
However, the code documentation for that method in core states: "Gets the field definitions for a specific bundle."
Additionally, there is a method in core to get the base field definitions: getBaseFieldDefinitions($entity_type_id)
.
I can provide steps to reproduce, if needed. We are using the collection module, and have created a search index and facets block that uses the label instead of the value for the block rendering. See https://www.drupal.org/project/collection/issues/3458552 π Error: Call to a member function getAllowedBundles() on null in collection_entity_bundle_field_info() Active .
Swap line 119 to use getBaseFieldDefinitions
instead of getFieldDefinitions
.
Active
3.0
Code