Enabling recycling bin results in errors and WSOD for entities

Created on 11 January 2021, over 4 years ago
Updated 6 June 2025, 26 days ago

Problem/Motivation

Enabling recycling bin for entities with bundles results in errors and for entities without bundles in WSOD.

Steps to reproduce

Try to enable entity type File or User, which don't have bundles, in the configuration form.

After inspecting the logs the following error is found:

Drupal\Core\Field\FieldException: Attempt to create a field 'recycle_bin' without a bundle. in Drupal\field\Entity\FieldConfig->__construct() (line 118 of /var/www/drupalvm/drupal/web/core/modules/field/src/Entity/FieldConfig.php).

Try to enable recycle bin for any other entity type which has bundles (for example taxonomy term) and two errors are thrown.

Notice: Undefined index: taxonomy_term in Drupal\entity_recycle\Form\EntityRecycleSettingsForm->updateRecycleBinField() (line 214 of modules/contrib/entity_recycle/src/Form/EntityRecycleSettingsForm.php).

Warning: array_diff(): Expected parameter 1 to be an array, null given in Drupal\entity_recycle\Form\EntityRecycleSettingsForm->updateRecycleBinField() (line 214 of modules/contrib/entity_recycle/src/Form/EntityRecycleSettingsForm.php).

Also the "leave empty for all" functionality doesn't work.

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇸🇮Slovenia jernejmramor

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇨🇦Canada phjou Vancouver 🇨🇦 🇪🇺

    I confirm, I am getting the same error:

    The website encountered an unexpected error. Try again later.
    Drupal\Core\Field\FieldException: Attempt to create a field 'recycle_bin' without a bundle. in Drupal\field\Entity\FieldConfig->__construct() (line 132 of core/modules/field/src/Entity/FieldConfig.php). 

    I agree with you that limit the choices for the time being is a good quick fix. We should add a comment on the settings page to explain why other entity types are not showing otherwise that can make some site builder/developers search for hours and not understanding why.

Production build 0.71.5 2024