Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am running a site on 8.1.2 with several contrib modules enabled. When visiting admin/structure/menu-position/add I get the following error:
The website encountered an unexpected error. Please try again later.
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "entity_bundle" plugin does not exist. in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 52 of core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).
Drupal\Core\Plugin\DefaultPluginManager->getDefinition('entity_bundle') (Line: 16)
Drupal\Core\Plugin\Factory\ContainerFactory->createInstance('entity_bundle', Array) (Line: 50)
Drupal\Core\Condition\ConditionManager->createInstance('entity_bundle') (Line: 125)
Drupal\menu_position\Form\MenuPositionRuleForm->form(Array, Object) (Line: 115)
Drupal\Core\Entity\EntityForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 512)
Drupal\Core\Form\FormBuilder->retrieveForm('menu_position_rule_form', Object) (Line: 271)
Drupal\Core\Form\FormBuilder->buildForm('menu_position_rule_form', Object) (Line: 74)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 139)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 62)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 98)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 77)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 628)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Comment | File | Size | Author |
---|---|---|---|
#11 | plugin_does_not_exist-2745295-11.patch | 656 bytes | ckaotik |
#5 | plugin_does_not_exist-2745295-5.patch | 1002 bytes | ckaotik |
Comments
Comment #2
Lukas von BlarerComment #3
lbainbridge CreditAttribution: lbainbridge at Northern Commerce commentedThanks for reporting this, would you mind also posting what contrib modules you are running? On a clean install I was unable to reproduce, so it seems likely that a contrib module with additional ConditionType plugins is interfering here. We are trying to be as agnostic and inclusive about conditions as possible, but it seems like we may need to implement some try/catch behaviour to avoid other modules possibly interfering with and breaking this one.
Comment #4
ckaotikI encountered the same issue, I think this might be caused by the CTools Conditions plugins that apply generically to entity types.
Some example entries using entity_bundle of the
$this->condition_plugin_manager->getDefinitions()
:Comment #5
ckaotikDid a temporary workaround to still allow for testing until this gets fixed properly :)
Comment #6
Lukas von BlarerThe patch makes the module usable for me. What needs to be done to fix this?
Comment #7
g089h515r806 CreditAttribution: g089h515r806 commentedI have the same issue, the patch fixed.
Comment #8
akalata CreditAttribution: akalata commentedComment #9
Lukas von BlarerAccording to the patch author this needs to be fixed different and needs tests.
Comment #10
ckaotikYup, my patch just fixes the symtoms that made configuring a MPR impossible. It doesn't touch the source of the problem.
We shouldn't exclude derived Condition plugins just because we don't know how to handle them yet ;)
Comment #11
ckaotikOkay, I must have been blind. Finally found the problem, which should be fixed with the attached patch. No interdiff, as this is a proper solution instead of the previous try-catch workaround.
For derived Condition plugins, we were using
$definition['id']
which is the base name, e.g.entity_bundle
, where we should have used the derived name, i.e.entity_bundle:node
.Comment #12
realrudymartin CreditAttribution: realrudymartin commentedcore/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php file is missing from the latest 8.1.10 drupal.org download
Do I copy the text from https://www.drupal.org/node/2710911 or download this from elsewhere?
I assumed core modules and plugins are checked before release. What happened here?
Comment #13
ckaotik@realrudymartin I think you might have gotten the wrong issue? :) This is for menu_position, which is not a core module.
Comment #14
Lukas von BlarerWorks for me. Thank you!
Comment #15
akalata CreditAttribution: akalata commentedBump, +1 for RTBC.
Comment #16
BarisW CreditAttribution: BarisW at LimoenGroen commentedThanks for the patch, looks good to me.
Comment #18
BarisW CreditAttribution: BarisW at LimoenGroen commentedComment #20
shefki CreditAttribution: shefki commentedI have become the same error but not related to the "Menu position".
Hier is what I did that I become the error (I could reproduce the same error with the same steps):
I created a content type "section".
I created a view with containing this sections (Unformated list, Showen as fields, owerwrite result). with the path "/home"
I created a taxonomy vocabulary name "group" and in there the term "home" ...
In the "home" term I defined "/home" as URL Alias.
I added in the content type "section" a new field "Taxonomy term" and in the created nodes from that contenttype I selected "home".
And that's cousin the error, after that I could not reach the /home page. But after removing the URL Alias /home from the taxonomy term its working again.
PHP Version: 5.6.27,
Drupal version: 8.2.5
Comment #21
venoel CreditAttribution: venoel commentedI catch this error after import database from production to development environment. Fixed by clearing all cache tables.