Problem/Motivation

Installing a site from existing configuration (drush site:install --existing-config) logs these errors when Trash is enabled for nodes and media:

'node' is enabled in trash.settings but its storage does not support Trash; entity queries for this type will fail until it is removed from the 'enabled_entity_types' configuration.
'media' is enabled in trash.settings but its storage does not support Trash; entity queries for this type will fail until it is removed from the 'enabled_entity_types' configuration.

The installer saves trash.settings while Trash itself is being installed, before Node and Media are. At that point the node and media entity types don't exist yet, so TrashConfigSubscriber::onSave() doesn't find them among the supported entity types and reports them as unsupported.

The errors are false: Trash still sets both entity types up later in the install, and node_field_data and media_field_data have the deleted column afterwards.

Steps to reproduce

  1. Enable Trash for nodes and media on a site, and export its configuration.
  2. Install a new site from that configuration with drush site:install --existing-config.
  3. The install output and the log show the two errors above.

Proposed resolution

In the check that reports unsupported entity types (added in ed599e4), skip entity types that have no definition yet. Existing entity types whose storage Trash can't use are still reported.

// Skip entity types that don't exist yet, whose modules aren't
// installed. For example, installing a site from existing
// configuration saves trash.settings when Trash is installed, before
// Node and Media.
if (!$this->entityTypeManager->hasDefinition($entity_type_id)) {
  continue;
}

Trash could re-run the check once all modules are installed. For example, a hook_modules_installed() implementation could log any entity types that still don't exist or still aren't supported. That would keep warning about genuinely broken configuration after the install, which the current patch doesn't.

Remaining tasks

  • Review the merge request.
  • Add a test that saves trash.settings listing an entity type whose module isn't installed, and checks that nothing is logged.

AI usage

Claude Code helped discover this bug and write the patch.

Issue fork trash-3631832

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

dave reid created an issue. See original summary.

dave reid’s picture

dave reid’s picture

Issue summary: View changes

amateescu made their first commit to this issue’s fork.

  • amateescu committed 8bd80e80 on 3.x
    fix: #3631832 False "storage does not support Trash" errors when...

  • amateescu committed a77c6fde on 3.1.x
    fix: #3631832 False "storage does not support Trash" errors when...
amateescu’s picture

Status: Active » Fixed

Merged, thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.