- Issue created by @SocialNicheGuru
- π©πͺGermany ktpm
Hi,
And I am stumped on how to actually enable the module
I noticed a missing dependency to commerce_cart that was added in the last release. Please try the updated version.
drush cr
Drupal\Component\Plugin\Exception\PluginNotFoundException: The
"commerce_plugin_item:commerce_recruiting_bonus_resolver" plugin does not
exist.The module is not installed yet.
I cannot reproduce this issue as plugins of disabled modules are ignored and should not produce this exception at all, so this issue may be out of scope for this module.
If the issue persists with the updated version, please provide more information about the steps for me to reproduce.
- Status changed to Closed: cannot reproduce
over 2 years ago 3:48pm 6 February 2023 - Status changed to Active
about 1 month ago 1:06pm 25 June 2025 - πΊπΈUnited States SocialNicheGuru
This is still an issue for me.
I think this might be an explanation:Even when disabled, the module's entity class files are being autoloaded during cache rebuilds. The Campaign entity class is being discovered and its baseFieldDefinitions() method is being called, which tries to create a field of type commerce_plugin_item:commerce_recruiting_bonus_resolver, but the plugin type doesn't exist because the module (and its services) are disabled.
This is a common issue with Drupal modules that define entity types with custom field types - the entity discovery happens before the module's services are available.1. Database Update Hook (commerce_recruiting.install) phpfunction commerce_recruiting_update_8003() { $recruitment_bonus_resolver = BaseFieldDefinition::create('commerce_plugin_item:commerce_recruiting_bonus_resolver') // ... field definition } 2. Entity Definition (Campaign.php) php$fields['recruitment_bonus_resolver'] = BaseFieldDefinition::create('commerce_plugin_item:commerce_recruiting_bonus_resolver') 3. Install Configuration yamlmodules/contrib/commerce_recruiting/config/install/commerce_plugin_item.commerce_recruiting_bonus_resolver.yml The problem: Even with the module disabled, Drupal is trying to run entity field discovery during cache rebuild, which loads the Campaign entity class, which tries to create the field definition that references the non-existent plugin type.