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.
As soon as I enable a promotion and try to load a product I see the following error:
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "request_path" 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('request_path') (Line: 16)
Drupal\Core\Plugin\Factory\ContainerFactory->createInstance('request_path', Array) (Line: 50)
Drupal\Core\Condition\ConditionManager->createInstance('request_path', Array) (Line: 81)
Drupal\Core\Plugin\DefaultLazyPluginCollection->initializePlugin('request_path') (Line: 80)
Drupal\Component\Plugin\LazyPluginCollection->get('request_path') (Line: 26)
Drupal\Core\Condition\ConditionPluginCollection->get('request_path') (Line: 148)
Drupal\Component\Plugin\LazyPluginCollection->getIterator() (Line: 99)
Drupal\block\BlockAccessControlHandler->checkAccess(Object, 'view', Object) (Line: 93)
Drupal\Core\Entity\EntityAccessControlHandler->access(Object, 'view', Object, 1) (Line: 340)
Drupal\Core\Entity\Entity->access('view', NULL, 1) (Line: 56)
Drupal\block\BlockRepository->getVisibleBlocksPerRegion(Array) (Line: 137)
Drupal\block\Plugin\DisplayVariant\BlockPageVariant->build() (Line: 259)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 117)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 149)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
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: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
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: 652)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
I've been unable to determine why this issue takes place, but as soon as I delete the promotion, the issue disappears.
Comments
Comment #2
chrisrikli CreditAttribution: chrisrikli commentedComment #3
chrisrikli CreditAttribution: chrisrikli commentedAdding to this issue...I can get past the system's inability to load the request_path plugin with a
drush cr
but then I hit this:Of course this plugin exists as part of the module out of the box.
Comment #4
bojanz CreditAttribution: bojanz commentedI've recently seen both errors as well, on a local install. Need to try and reproduce it again.
What's weird is that both of these plugins definitely exist, one provided by core, the other provided by commerce_promotion.
Smells like half-built discovery caches.
Comment #5
a.dmitriiev CreditAttribution: a.dmitriiev as a volunteer and at 1xINTERNET commentedI found this error also locally. I traced it down to this file modules\promotion\src\PromotionConditionManager.php and this class PromotionConditionManager.
In construct method now 'condition_plugins' is used as CacheBackend and I assume this is not correct, because core conditions are not compatible with commerce promotion conditions.
My suggestion is to change the constructor like this:
I just added the prefix to alter hook and to cache backend key
This fixed the error for me.
Comment #7
bojanz CreditAttribution: bojanz commentedThanks a.dmitriiev, that did the trick.