The "commerce_plugin_item:commerce_recruiting_bonus_resolver" plugin does not exist.

Created on 5 February 2023, over 2 years ago

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

πŸ› Bug report
Status

Active

Version

8.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States SocialNicheGuru

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

Comments & Activities

  • 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
  • Status changed to Active about 1 month ago
  • πŸ‡ΊπŸ‡Έ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.
Production build 0.71.5 2024