Problem/Motivation

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.

Discovering it's plugin causes an error.

I am placing this as Major because simply downloading the module and having it on the system will cause a WSOD.

And I am stumped on how to actually enable the module

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

SocialNicheGuru created an issue. See original summary.

ktpm’s picture

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.

socialnicheguru’s picture

Status: Active » Closed (cannot reproduce)
socialnicheguru’s picture

Status: Closed (cannot reproduce) » Active

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.

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.