Node deletions are not logged because "content" is not an entity type

Created on 22 August 2025, about 1 month ago

Problem/Motivation

When configuring the entity_delete_log module at /admin/config/entity-delete-log, there is no option for "Node". The closest option is "Content". I can understand the frustration with Drupal core's inconsistent terminology, so I understand the desire to call nodes content. However, the machine name of the entity type is node not content. Terminology aside, the real problem is that in entity_delete_log_entity_delete() there is this bit of code:

// If the incoming entity type is enabled for logging, let's log it.
  if (in_array($type, $entity_types, TRUE)) {

Here $entity_types is an array of each checkbox checked on the entity_delete_log configuration form, including "content" if checked. What this means is that when a node is deleted, the if statement evaluates to false and the node deletion is not logged.

Steps to reproduce

Proposed resolution

Somehow fix this in a backwards compatible way.

I set the priority to major since node is by far the most common entity type.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

1.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States maskedjellybean Portland, OR

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

Comments & Activities

Production build 0.71.5 2024