Problem/Motivation
In the default configuration, the module crashes the whole backend of a site with the error
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "0" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 139 of core\lib\Drupal\Core\Entity\EntityTypeManager.php).
Therefore, the configuration also can't be changed after freshly installing the module.
Steps to reproduce
Just install the module and try accessing any configuration page.
Proposed resolution
The reason is that in the function getEnabledEntityTypes() (line 89 in TrashManager.php), the array keys of the configuration are taken, but the configuration of the entity types is loaded as [0 => 'node'].
Remaining tasks
Assure that getEnabledEntityTypes gives a valid result for every configuration.
Issue fork trash-3453832
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
Comment #2
amateescu commentedDid you run the database updates after upgrading to 3.0.4?
trash_post_update_set_enabled_entity_types_bundles()updates the trash.settings configuration to the (new) structure required bygetEnabledEntityTypes().Comment #3
moritzkunz commentedMy bad. It was a fresh installation, but someone had put the old default configuration into the profile I installed from, thus overriding the new one. Issue can be closed.
Comment #4
amateescu commentedThanks :)
Comment #5
berdirReopening this, we're running into this error as part of running updates, specifically block_content_post_update_revision_type().
Since post updates can't depend on others and if this configuration change is required for the code to not fail, I think there should either be a guard-rail in place or the update should be a regular update function and not a post update.
Will look into providing a patch when I get to it,
Comment #9
primsi commentedPushed first to fork 3.x :S Ignore that one, ... first day after holidays.
I went with the second suggestion from @Berdir
Comment #11
amateescu commentedMerged and released 3.0.6, thanks!