diff --git a/core/modules/editor/editor.module b/core/modules/editor/editor.module index 81dd624..b12ca6c 100644 --- a/core/modules/editor/editor.module +++ b/core/modules/editor/editor.module @@ -445,6 +445,10 @@ function editor_entity_update(EntityInterface $entity) { * Implements hook_entity_delete(). */ function editor_entity_delete(EntityInterface $entity) { + // Only act on content entities. + if (!($entity instanceof ContentEntityInterface)) { + return; + } $referenced_files_by_field = _editor_get_file_uuids_by_field($entity); foreach ($referenced_files_by_field as $field => $uuids) { _editor_delete_file_usage($uuids, $entity, 0); @@ -455,6 +459,10 @@ function editor_entity_delete(EntityInterface $entity) { * Implements hook_entity_revision_delete(). */ function editor_entity_revision_delete(EntityInterface $entity) { + // Only act on content entities. + if (!($entity instanceof ContentEntityInterface)) { + return; + } $referenced_files_by_field = _editor_get_file_uuids_by_field($entity); foreach ($referenced_files_by_field as $field => $uuids) { _editor_delete_file_usage($uuids, $entity, 1);