Error: Call to undefined method Symfony\Component\HttpFoundation\RequestStack::getMasterRequest()

Created on 30 March 2023, about 1 year ago
Updated 31 March 2023, about 1 year ago

On D10 I have

Error: Call to undefined method Symfony\Component\HttpFoundation\RequestStack::getMasterRequest() in Drupal\commerce_product\ContextProvider\ProductVariationContext->getRuntimeContexts() (line 112 of /DATA/home-sites/lom/web/modules/contrib/commerce/modules/product/src/ContextProvider/ProductVariationContext.php).
#0 /DATA/home-sites/lom/web/modules/contrib/commerce/modules/product/src/ContextProvider/ProductVariationContext.php(166): Drupal\commerce_product\ContextProvider\ProductVariationContext->getRuntimeContexts(Array)
#1 /DATA/home-sites/lom/web/core/lib/Drupal/Core/Plugin/Context/LazyContextRepository.php(97): Drupal\commerce_product\ContextProvider\ProductVariationContext->getAvailableContexts()
#2 /DATA/home-sites/lom/web/core/lib/Drupal/Core/ParamConverter/EntityConverter.php(141): Drupal\Core\Plugin\Context\LazyContextRepository->getAvailableContexts()
#3 /DATA/home-sites/lom/web/core/lib/Drupal/Core/ParamConverter/ParamConverterManager.php(100): Drupal\Core\ParamConverter\EntityConverter->convert('front-panels_va...', Array, 'page_manager_pa...', Array)
#4 /DATA/home-sites/lom/web/core/lib/Drupal/Core/Routing/Enhancer/ParamConversionEnhancer.php(45): Drupal\Core\ParamConverter\ParamConverterManager->convert(Array)
#5 /DATA/home-sites/lom/web/core/lib/Drupal/Core/Routing/Router.php(238): Drupal\Core\Routing\Enhancer\ParamConversionEnhancer->enhance(Array, Object(Symfony\Component\HttpFoundation\Request))
#6 /DATA/home-sites/lom/web/core/lib/Drupal/Core/Routing/Router.php(118): Drupal\Core\Routing\Router->applyRouteEnhancers(Array, Object(Symfony\Component\HttpFoundation\Request))
#7 /DATA/home-sites/lom/web/core/lib/Drupal/Core/Routing/AccessAwareRouter.php(87): Drupal\Core\Routing\Router->matchRequest(Object(Symfony\Component\HttpFoundation\Request))
#8 /DATA/home-sites/lom/vendor/symfony/http-kernel/EventListener/RouterListener.php(105): Drupal\Core\Routing\AccessAwareRouter->matchRequest(Object(Symfony\Component\HttpFoundation\Request))
#9 [internal function]: Symfony\Component\HttpKernel\EventListener\RouterListener->onKernelRequest(Object(Symfony\Component\HttpKernel\Event\RequestEvent), 'kernel.request', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#10 /DATA/home-sites/lom/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\RequestEvent), 'kernel.request', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#11 /DATA/home-sites/lom/vendor/symfony/http-kernel/HttpKernel.php(139): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object(Symfony\Component\HttpKernel\Event\RequestEvent), 'kernel.request')
#12 /DATA/home-sites/lom/vendor/symfony/http-kernel/HttpKernel.php(74): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#13 /DATA/home-sites/lom/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#14 /DATA/home-sites/lom/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#15 /DATA/home-sites/lom/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(191): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#16 /DATA/home-sites/lom/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(128): Drupal\page_cache\StackMiddleware\PageCache->fetch(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#17 /DATA/home-sites/lom/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(82): Drupal\page_cache\StackMiddleware\PageCache->lookup(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#18 /DATA/home-sites/lom/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#19 /DATA/home-sites/lom/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#20 /DATA/home-sites/lom/web/modules/contrib/remove_http_headers/src/StackMiddleware/RemoveHttpHeadersMiddleware.php(49): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#21 /DATA/home-sites/lom/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\remove_http_headers\StackMiddleware\RemoveHttpHeadersMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#22 /DATA/home-sites/lom/web/core/lib/Drupal/Core/DrupalKernel.php(686): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#23 /DATA/home-sites/lom/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#24 {main}

Fix like in this patch fixed the error: https://www.drupal.org/files/issues/2022-12-15/3327265-fix-undefined-met...

🐛 Bug report
Status

Fixed

Version

2.34

Component

Product

Created by

🇺🇦Ukraine super_romeo Kiev

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

Comments & Activities

Production build 0.69.0 2024