Checkout throws an unhelpful error if no default checkout flow can be found

Created on 27 April 2019, over 5 years ago
Updated 22 March 2024, 8 months ago

When i try to checkout i get an error immediately ..

Drupal 8.6.15, PHP 7.1, My Sql 5.7, commerce 8.x-2.12

I am new to drupal if the error report requires more details let me know i will add them.. If i have missed any configuration that might require plz let me know as i am new to drupal ..

Error Log:

Error: Call to a member function getPlugin() on null in Drupal\commerce_checkout\CheckoutOrderManager->getCheckoutStepId() (line 52 of /home/mywebsite/public_html/modules/commerce/modules/checkout/src/CheckoutOrderManager.php) #0 /home/mywebsite/public_html/modules/commerce/modules/checkout/src/Controller/CheckoutController.php(86): Drupal\commerce_checkout\CheckoutOrderManager->getCheckoutStepId(Object(Drupal\commerce_order\Entity\Order), NULL) #1 [internal function]: Drupal\commerce_checkout\Controller\CheckoutController->formPage(Object(Drupal\Core\Routing\RouteMatch)) #2 /home/mywebsite/public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) #3 /home/mywebsite/public_html/core/lib/Drupal/Core/Render/Renderer.php(582): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #4 /home/mywebsite/public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #5 /home/mywebsite/public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) #6 /home/mywebsite/public_html/vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #7 /home/mywebsite/public_html/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #8 /home/mywebsite/public_html/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #9 /home/mywebsite/public_html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #10 /home/mywebsite/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #11 /home/mywebsite/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #12 /home/mywebsite/public_html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #13 /home/mywebsite/public_html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #14 /home/mywebsite/public_html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #15 /home/mywebsite/public_html/core/lib/Drupal/Core/DrupalKernel.php(693): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #16 /home/mywebsite/public_html/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #17 {main}.

🐛 Bug report
Status

Needs review

Version

2.0

Component

Checkout

Created by

🇮🇳India merilturock

Live updates comments and jobs are added and updated live.
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.

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.0 & MySQL 5.7
    last update 8 months ago
    793 pass
  • 🇩🇪Germany gogowitsch

    I encountered this exact error when setting up my store. The explanation in #4 is correct.

    Regarding czigor's patch: it only fixes the issue in 1 of the 3 locations where getCheckoutFlow() is called.

    I have attached a much smaller fix. Maybe we can get this committed and released quicker this way. Given that the error happens to IT folks (not end users) I find it sufficient to show it in the /admin/reports/dblog.

Production build 0.71.5 2024