diff --git a/src/Plugin/monitoring/SensorPlugin/ContentEntityAggregatorSensorPlugin.php b/src/Plugin/monitoring/SensorPlugin/ContentEntityAggregatorSensorPlugin.php index 3edc634..6bae2ca 100644 --- a/src/Plugin/monitoring/SensorPlugin/ContentEntityAggregatorSensorPlugin.php +++ b/src/Plugin/monitoring/SensorPlugin/ContentEntityAggregatorSensorPlugin.php @@ -244,7 +244,7 @@ class ContentEntityAggregatorSensorPlugin extends DatabaseAggregatorSensorPlugin break; default: - if ($entity->hasField($field)) { + if (is_subclass_of($entity, '\Drupal\Core\Entity\FieldableEntityInterface', TRUE) && $entity->hasField($field)) { $property = $entity->getFieldDefinition($field)->getFieldStorageDefinition()->getMainPropertyName(); $value = $entity->$field->view(['label' => 'hidden']); $row[] = $value ? \Drupal::service('renderer')->renderPlain($value) : $entity->$field->$property; @@ -302,7 +302,7 @@ class ContentEntityAggregatorSensorPlugin extends DatabaseAggregatorSensorPlugin $options = []; foreach ($entity_types as $id => $label) { $class = $this->entityManager->getDefinition($id)->getClass(); - if (is_subclass_of($class, '\Drupal\Core\Entity\FieldableEntityInterface', TRUE)) { + if (is_subclass_of($class, '\Drupal\Core\Entity\ContentEntityInterface', TRUE)) { $options[$id] = $label; }; }