Uncaught exception Error with message Call to a member function bundle() on string in /Drupal/Core/Entity/Plugin/Condition/EntityBundle.php:92

Created on 24 January 2022, over 2 years ago
Updated 13 July 2023, over 1 year ago

Problem/Motivation

I'm getting the error Uncaught exception 'Error' with message 'Call to a member function bundle() on string in /Drupal/Core/Entity/Plugin/Condition/EntityBundle.php:92'.

I see that there is an issue open for changing bundle name but probably this is not related.

I'm running Drupal 9.3.3

Here is the full trace.

 in Drupal\Core\Entity\Plugin\Condition\EntityBundle::evaluate called at /mnt/www/html/detroitmi/docroot/core/lib/Drupal/Core/Condition/ConditionManager.php (77)
 in Drupal\Core\Condition\ConditionManager::execute called at /mnt/www/html/detroitmi/docroot/core/lib/Drupal/Core/Condition/ConditionPluginBase.php (84)
 in Drupal\Core\Condition\ConditionPluginBase::execute called at /mnt/www/html/detroitmi/docroot/core/lib/Drupal/Core/Condition/ConditionAccessResolverTrait.php (26)
 in Drupal\page_manager\Entity\PageVariantAccess::resolveConditions called at /mnt/www/html/detroitmi/docroot/modules/contrib/page_manager/src/Entity/PageVariantAccess.php (75)
 in Drupal\page_manager\Entity\PageVariantAccess::checkAccess called at /mnt/www/html/detroitmi/docroot/core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php (105)
 in Drupal\Core\Entity\EntityAccessControlHandler::access called at /mnt/www/html/detroitmi/docroot/core/lib/Drupal/Core/Entity/EntityBase.php (314)
 in Drupal\Core\Entity\EntityBase::access called at /mnt/www/html/detroitmi/docroot/modules/contrib/page_manager/src/Routing/VariantRouteFilter.php (188)
 in Drupal\page_manager\Routing\VariantRouteFilter::checkPageVariantAccess called at /mnt/www/html/detroitmi/docroot/modules/contrib/page_manager/src/Routing/VariantRouteFilter.php (135)
 in Drupal\page_manager\Routing\VariantRouteFilter::getVariantRouteName called at /mnt/www/html/detroitmi/docroot/modules/contrib/page_manager/src/Routing/VariantRouteFilter.php (82)
 in Drupal\page_manager\Routing\VariantRouteFilter::filter called at /mnt/www/html/detroitmi/docroot/core/lib/Drupal/Core/Routing/Router.php (280)
 in Drupal\Core\Routing\Router::applyRouteFilters called at /mnt/www/html/detroitmi/docroot/core/lib/Drupal/Core/Routing/Router.php (126)
 in Drupal\Core\Routing\Router::matchRequest called at /mnt/www/html/detroitmi/docroot/core/lib/Drupal/Core/Url.php (489)
 in Drupal\Core\Url::createFromRequest called at /mnt/www/html/detroitmi/docroot/modules/contrib/token/token.tokens.inc (923)
 in token_tokens called at ? (?)
 in call_user_func_array called at /mnt/www/html/detroitmi/docroot/core/lib/Drupal/Core/Extension/ModuleHandler.php (403)
 in Drupal\Core\Extension\ModuleHandler::invokeAll called at /mnt/www/html/detroitmi/docroot/core/lib/Drupal/Core/Utility/Token.php (304)
 in Drupal\Core\Utility\Token::generate called at /mnt/www/html/detroitmi/docroot/core/lib/Drupal/Core/Utility/Token.php (196)
 in Drupal\Core\Utility\Token::replace called at /mnt/www/html/detroitmi/docroot/modules/contrib/metatag/src/MetatagToken.php (66)
 in Drupal\metatag\MetatagToken::replace called at /mnt/www/html/detroitmi/docroot/modules/contrib/metatag/src/MetatagManager.php (586)
 in Drupal\metatag\MetatagManager::generateRawElements called at /mnt/www/html/detroitmi/docroot/modules/contrib/metatag/src/MetatagManager.php (493)
 in Drupal\metatag\MetatagManager::generateElements called at /mnt/www/html/detroitmi/docroot/modules/contrib/metatag/metatag.module (529)
 in metatag_get_tags_from_route called at /mnt/www/html/detroitmi/docroot/modules/contrib/metatag/metatag.module (127)
 in metatag_page_attachments called at /mnt/www/html/detroitmi/docroot/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php (312)
 in Drupal\Core\Render\MainContent\HtmlRenderer::invokePageAttachmentHooks called at /mnt/www/html/detroitmi/docroot/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php (288)
 in Drupal\Core\Render\MainContent\HtmlRenderer::prepare called at /mnt/www/html/detroitmi/docroot/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php (132)
 in Drupal\Core\Render\MainContent\HtmlRenderer::renderResponse called at /mnt/www/html/detroitmi/docroot/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php (90)
 in Drupal\Core\EventSubscriber\MainContentViewSubscriber::onViewRenderArray called at ? (?)
 in call_user_func called at /mnt/www/html/detroitmi/docroot/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php (142)
 in Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher::dispatch called at /mnt/www/html/detroitmi/vendor/symfony/http-kernel/HttpKernel.php (163)
 in Symfony\Component\HttpKernel\HttpKernel::handleRaw called at /mnt/www/html/detroitmi/vendor/symfony/http-kernel/HttpKernel.php (80)
 in Symfony\Component\HttpKernel\HttpKernel::handle called at /mnt/www/html/detroitmi/docroot/core/lib/Drupal/Core/StackMiddleware/Session.php (58)
 in Drupal\Core\StackMiddleware\Session::handle called at /mnt/www/html/detroitmi/docroot/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php (48)
 in Drupal\Core\StackMiddleware\KernelPreHandle::handle called at /mnt/www/html/detroitmi/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php (106)
 in Drupal\page_cache\StackMiddleware\PageCache::pass called at /mnt/www/html/detroitmi/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php (85)
 in Drupal\page_cache\StackMiddleware\PageCache::handle called at /mnt/www/html/detroitmi/vendor/asm89/stack-cors/src/Asm89/Stack/Cors.php (49)
 in Asm89\Stack\Cors::handle called at /mnt/www/html/detroitmi/docroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php (48)
 in Drupal\Core\StackMiddleware\ReverseProxyMiddleware::handle called at /mnt/www/html/detroitmi/docroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php (51)
 in Drupal\Core\StackMiddleware\NegotiationMiddleware::handle called at /mnt/www/html/detroitmi/vendor/stack/builder/src/Stack/StackedHttpKernel.php (23)
 in Stack\StackedHttpKernel::handle called at /mnt/www/html/detroitmi/docroot/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php (166)
 in Drupal\Core\EventSubscriber\DefaultExceptionHtmlSubscriber::makeSubrequest called at /mnt/www/html/detroitmi/docroot/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php (122)
 in Drupal\Core\EventSubscriber\DefaultExceptionHtmlSubscriber::on404 called at /mnt/www/html/detroitmi/docroot/core/lib/Drupal/Core/EventSubscriber/HttpExceptionSubscriberBase.php (109)
 in Drupal\Core\EventSubscriber\HttpExceptionSubscriberBase::onException called at ? (?)
 in call_user_func called at /mnt/www/html/detroitmi/docroot/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php (142)
 in Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher::dispatch called at /mnt/www/html/detroitmi/vendor/symfony/http-kernel/HttpKernel.php (219)
 in Symfony\Component\HttpKernel\HttpKernel::handleThrowable called at /mnt/www/html/detroitmi/vendor/symfony/http-kernel/HttpKernel.php (91)
 in Symfony\Component\HttpKernel\HttpKernel::handle called at /mnt/www/html/detroitmi/docroot/core/lib/Drupal/Core/StackMiddleware/Session.php (58)
 in Drupal\Core\StackMiddleware\Session::handle called at /mnt/www/html/detroitmi/docroot/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php (48)
 in Drupal\Core\StackMiddleware\KernelPreHandle::handle called at /mnt/www/html/detroitmi/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php (191)
 in Drupal\page_cache\StackMiddleware\PageCache::fetch called at /mnt/www/html/detroitmi/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php (128)
 in Drupal\page_cache\StackMiddleware\PageCache::lookup called at /mnt/www/html/detroitmi/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php (82)
 in Drupal\page_cache\StackMiddleware\PageCache::handle called at /mnt/www/html/detroitmi/vendor/asm89/stack-cors/src/Asm89/Stack/Cors.php (49)
 in Asm89\Stack\Cors::handle called at /mnt/www/html/detroitmi/docroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php (48)
 in Drupal\Core\StackMiddleware\ReverseProxyMiddleware::handle called at /mnt/www/html/detroitmi/docroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php (51)
 in Drupal\Core\StackMiddleware\NegotiationMiddleware::handle called at /mnt/www/html/detroitmi/vendor/stack/builder/src/Stack/StackedHttpKernel.php (23)
 in Stack\StackedHttpKernel::handle called at /mnt/www/html/detroitmi/docroot/core/lib/Drupal/Core/DrupalKernel.php (708)
 in Drupal\Core\DrupalKernel::handle called at /mnt/www/html/detroitmi/docroot/index.php (19)
πŸ› Bug report
Status

Needs work

Version

9.5

Component
EntityΒ  β†’

Last updated about 7 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States jedgar1mx Detroit

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

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.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Reopening for further investigation.

  • Status changed to Postponed: needs info 4 months ago
  • πŸ‡ΊπŸ‡¦Ukraine vlad.dancer Kyiv

    We had the same problem with EntityBundle condition and it seems the commerce_product, menu_position, context modules could trigger such issue.
    But nowadays (drupal 10.3.0) we have no problem on this page. It looks like somewhere in the mentioned module's releases this error has been fixed.

  • πŸ‡§πŸ‡ͺBelgium jelle_s Antwerp, Belgium

    Just to be sure, for those that might still need it, here is the reroll for 10.3.x

  • πŸ‡ΉπŸ‡­Thailand AlfTheCat

    Patch #17 fixed the issue for me on Drupal 10.3.5, I was getting this error when attempting to duplicate commerce product variations. My stacktrace pointed to the context module but there are not contexts involved in any way with commerce product or product variation entities, except for one that controls block placements but disabling it did not resolve the issue.

    Thanks for the patch!

Production build 0.71.5 2024