diff --git a/src/Plugin/facets/processor/ListItemProcessor.php b/src/Plugin/facets/processor/ListItemProcessor.php index 44085fc..12516c3 100644 --- a/src/Plugin/facets/processor/ListItemProcessor.php +++ b/src/Plugin/facets/processor/ListItemProcessor.php @@ -79,16 +79,15 @@ class ListItemProcessor extends ProcessorPluginBase implements BuildProcessorInt } // If it's an entity base field, we find it in the field definitions. - // Unfortunately we don't have access to the bundle via SearchApiFacetSourceInterface, - // so we check the entity's base fields only. - $baseFields = $this->entityFieldManager->getFieldDefinitions($entity, ''); + // 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, ''); - // If it's a field.module field we can look it up this way: + // This only works for configurable fields. $config_entity_name = sprintf('field.storage.%s.%s', $entity, $field_identifier); - // Is this a base field, or a field.module field? - if (isset($baseFields[$field_identifier])) { - $field = $baseFields[$field_identifier]; + if (isset($base_fields[$field_identifier])) { + $field = $base_fields[$field_identifier]; } elseif ($this->configManager->loadConfigEntityByName($config_entity_name) !== NULL) { $field = $this->configManager->loadConfigEntityByName($config_entity_name);