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
- Use the shop as anonymous user
- Add an item to cart
- Go to cart
- Go to checkout
- Select guest checkout (no registration or login): "Continue as guest"
- Enter your contact and payment details
- Click "Continue to review"
- 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
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
Comment #2
abhishek_gupta1 commentedComment #3
abhishek_gupta1 commentedComment #5
abhishek_gupta1 commentedfixed the issue and created MR, please review it once
Comment #6
anybodySadly I don't think you catched the root cause and the tests fail.
Comment #7
anybodyIssue still exists, just found it in the logs of a client. Someone experienced that in checkout.
Comment #8
i.koychev commentedI 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
Comment #9
adam1 commentedSame 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)
Comment #11
pfrenssenI 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.
Comment #12
jsacksick commentedI'm willing to commit this but there are currently merge conflicts.
@pfrenssen: Would you be able to solve this please?
Comment #13
pfrenssenSure! Done :)
Comment #15
jsacksick commentedComment #16
jsacksick commentedThank you!