Warning: Undefined property: MultistepDefault::$order in order_information step as anonymous user

Created on 16 October 2024, 6 months ago

Problem/Motivation

Going through the checkout as anonymous user (Guest checkout), I get the following Warning, when submitting the "order_information" step form:

Warning: Undefined property: Drupal\commerce_checkout\Plugin\Commerce\CheckoutFlow\MultistepDefault::$order in Drupal\commerce_checkout\Plugin\Commerce\CheckoutFlow\CheckoutFlowBase->getOrder() (line 167 of modules/contrib/commerce/modules/checkout/src/Plugin/Commerce/CheckoutFlow/CheckoutFlowBase.php).

Steps to reproduce

  1. Use the shop as anonymous user
  2. Add an item to cart
  3. Go to cart
  4. Go to checkout
  5. Select guest checkout (no registration or login): "Continue as guest"
  6. Enter your contact and payment details
  7. Click "Continue to review"
  8. See the error

We're using commerce_shipping, so I'm unsure if this is a commerce_shipping issue and related to the AJAX calls in the background or a Commerce issue. Any ideas how that could happen?

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Describe your bug or feature request.

If a bug, provide steps to reproduce it from a clean install.

🐛 Bug report
Status

Active

Version

3.0

Component

Checkout

Created by

🇩🇪Germany Anybody Porta Westfalica

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

Merge Requests

Comments & Activities

  • Issue created by @Anybody
  • Merge request !348fix the issue → (Open) created by abhishek_virasat
  • 🇮🇳India abhishek_virasat

    fixed the issue and created MR, please review it once

  • Pipeline finished with Failed
    6 months ago
    Total: 672s
    #311363
  • 🇩🇪Germany Anybody Porta Westfalica

    Sadly I don't think you catched the root cause and the tests fail.

  • 🇩🇪Germany Anybody Porta Westfalica

    Issue still exists, just found it in the logs of a client. Someone experienced that in checkout.

  • Status changed to Needs work about 2 months ago
  • 🇧🇬Bulgaria i.koychev Sofia

    I have the same issue. Appears only in logs e.g. when changing the payment method
    Location: checkout/xxx/order_information?_wrapper_format=drupal_ajax&ajax_form=1
    - Drupal 10.3.0
    - Commerce 8.x-2.40

  • 🇩🇪Germany adam1

    Same here on Drupal 10.4.3 Commerce 8.x-2.4. The warning appear on the page, for logged-in and anonymous users:

    Warning: Undefined property: Drupal\commerce_checkout\Plugin\Commerce\CheckoutFlow\MultistepDefault::$order in Drupal\commerce_checkout\Plugin\Commerce\CheckoutFlow\CheckoutFlowBase->getOrder() (line 167 of modules/contrib/commerce/modules/checkout/src/Plugin/Commerce/CheckoutFlow/CheckoutFlowBase.php).
    Drupal\commerce_checkout\Plugin\Commerce\CheckoutFlow\CheckoutFlowBase->getOrder() (Line: 233)
    Drupal\commerce_checkout\Plugin\Commerce\CheckoutFlow\CheckoutFlowBase->getStepId() (Line: 50)
    Drupal\commerce_checkout\CheckoutOrderManager->getCheckoutStepId() (Line: 94)
    Drupal\commerce_checkout\Plugin\Block\CheckoutProgressBlock->build() (Line: 171)
    Drupal\block\BlockViewBuilder::preRender()
    call_user_func_array() (Line: 113)
    Drupal\Core\Render\Renderer->doTrustedCallback() (Line: 870)
    Drupal\Core\Render\Renderer->doCallback() (Line: 432)
    Drupal\Core\Render\Renderer->doRender() (Line: 504)
    Drupal\Core\Render\Renderer->doRender() (Line: 248)
    Drupal\Core\Render\Renderer->render() (Line: 484)
    Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 100)
    __TwigTemplate_130ea0b20e16b7458dc8789110f80010->doDisplay() (Line: 388)
    Twig\Template->yield() (Line: 344)
    Twig\Template->display() (Line: 359)
    Twig\Template->render() (Line: 51)
    Twig\TemplateWrapper->render() (Line: 33)
    twig_render_template() (Line: 348)
    Drupal\Core\Theme\ThemeManager->render() (Line: 491)
    Drupal\Core\Render\Renderer->doRender() (Line: 248)
    Drupal\Core\Render\Renderer->render() (Line: 484)
    Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 91)
    __TwigTemplate_80e4a832c064768b4b184dd17715a366->doDisplay() (Line: 388)
    Twig\Template->yield() (Line: 344)
    Twig\Template->display() (Line: 359)
    Twig\Template->render() (Line: 51)
    Twig\TemplateWrapper->render() (Line: 33)
    twig_render_template() (Line: 348)
    Drupal\Core\Theme\ThemeManager->render() (Line: 491)
    Drupal\Core\Render\Renderer->doRender() (Line: 248)
    Drupal\Core\Render\Renderer->render() (Line: 158)
    Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 638)
    Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 153)
    Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse() (Line: 90)
    Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
    call_user_func() (Line: 111)
    Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 186)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
    Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
    Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
    Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
    Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 116)
    Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90)
    Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
    Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
    Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 741)
    Drupal\Core\DrupalKernel->handle() (Line: 19)

Production build 0.71.5 2024