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.

Issue fork commerce-3481073

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

anybody created an issue. See original summary.

abhishek_gupta1’s picture

Assigned: Unassigned » abhishek_gupta1
abhishek_gupta1’s picture

abhishek_gupta1’s picture

Assigned: abhishek_gupta1 » Unassigned
Status: Active » Needs review

fixed the issue and created MR, please review it once

anybody’s picture

Status: Needs review » Needs work

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

anybody’s picture

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

i.koychev’s picture

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

adam1’s picture

Same here on Drupal 10.4.3 Commerce 8.x-2.4. The warning appears 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)

pfrenssen made their first commit to this issue’s fork.

pfrenssen’s picture

I merged in the latest changes from 3.x and it turns out the main cause of the issue was fixed recently, in #3535420: Fix phpstan and stylelint issues.

The current patch makes this a bit more robust, but probably the bug is already fixed in the latest 3.x-dev.

jsacksick’s picture

Version: 3.0.x-dev » 3.x-dev

I'm willing to commit this but there are currently merge conflicts.
@pfrenssen: Would you be able to solve this please?

pfrenssen’s picture

Status: Needs work » Needs review

Sure! Done :)

jsacksick’s picture

Status: Needs review » Fixed
jsacksick’s picture

Thank you!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.