Error: Call to a member function getFormModeOptions() on null

Created on 11 September 2024, 7 months ago
Updated 14 November 2024, 5 months ago

Describe your bug or feature request.

Login.php throws exception while editing the default checkout pane.
Error: Call to a member function getFormModeOptions() on null in Drupal\commerce_checkout\Plugin\Commerce\CheckoutPane\Login->buildConfigurationForm() (line 144 of /code/web/modules/contrib/commerce/modules/checkout/src/Plugin/Commerce/CheckoutPane/Login.php).

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

After updating commerce to 3.0.alpha version. then the system throws this exception. The dev version also throws the error.

🐛 Bug report
Status

Active

Version

3.0

Component

Checkout

Created by

🇵🇰Pakistan Qaiser iqbal

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

Comments & Activities

  • Issue created by @Qaiser iqbal
  • First commit to issue fork.
  • 🇰🇬Kyrgyzstan dan_metille

    Same error while updating from Commerce 8.x-2 to any 3.0.0 version. Any idea about how to fix it?

  • 🇮🇱Israel jsacksick

    Do you define a custom checkout pane extending the Login pane? This isn't happening for me on a default install, so I'm assuming custom code is triggering this, therefore lowering the issue priority.

  • 🇮🇱Israel jsacksick

    Closing this as this isn't happening on a Vanilla install... Feel free to reopen in case you are able to provide reproducible steps on a clean install.

  • 🇵🇰Pakistan Qaiser iqbal

    No, I don't have any custom checkout pane. I am only using commerce_recurring and commerce_license. They might have causing the issue.

  • 🇮🇱Israel jsacksick

    Again, without reproducible steps... Not much I can do, On a test install I have, with commerce 3 enabled, commerce_license & commerce_recurring, I'm not experiencing this...

  • Status changed to Postponed: needs info 2 months ago
  • 🇱🇰Sri Lanka lakhithaD

    I got the same error described below when trying to edit or create any checkout workflow. Im on Drupal 10.4 and commerce 3.0.0.
    Issue solved when downgraded to commerce 2.4 and the error is gone.

    Error: Call to a member function getFormModeOptions() on null in Drupal\commerce_checkout\Plugin\Commerce\CheckoutPane\Login->buildConfigurationForm() (line 144 of /var/www/html/web/modules/contrib/commerce/modules/checkout/src/Plugin/Commerce/CheckoutPane/Login.php).
    Severity	Error
  • Thanks @lakhithad, indeed in my case it was also email_registration which caused the problem

Production build 0.71.5 2024