Call to a member function getCurrentRequest() on null in EmailRegistrationLogin->validatePaneForm()

Created on 23 April 2025, 5 months ago

Hello,
After upgrading from 2.0.0-rc7 to 2.0.0-rc8, we have an the error
Call to a member function getCurrentRequest() on null in EmailRegistrationLogin->validatePaneForm()
when a user tries to log from Drupal Commerce during the checkout process and the email does match an existing user but the password is incorrect
we indeed reach line 127 of EmailRegistrationLogin->validatePaneForm():
$client_ip = $this->requestStack->getCurrentRequest()->getClientIp();
that has been modified since rc7
🐛 Fix CI on 2.x HEAD Active
https://git.drupalcode.org/project/email_registration/-/merge_requests/5...
from
$this->credentialsCheckFlood->register($this->clientIp, $username);
to

$client_ip = $this->requestStack->getCurrentRequest()->getClientIp();
$this->credentialsCheckFlood->register($client_ip, $username);

BTW I have PHPStorm highlighting requestStack and saying
Property 'requestStack' not found in EmailRegistrationLogin
I also noticed in the same MR you upgraded drupal/commerce to ^3.0 (but only in require-dev) and we are not on Commerce 3 yet. Does this new code require Commerce 3 to work?

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇫🇷France nicolas bouteille

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

Merge Requests

Comments & Activities

  • Issue created by @nicolas bouteille
  • First commit to issue fork.
  • Merge request !60register() first parameter now matches... → (Open) created by rsnyd
  • Pipeline finished with Failed
    4 months ago
    Total: 498s
    #509748
  • Assigned to ushma
  • 🇮🇳India ushma

    The previously opened MR got failed due to this error :
    Access to an undefined property Drupal\email_registration\Plugin\Commerce\CheckoutPane\EmailRegistrationLogin::$clientIp.

    Attaching a patch to resolve the issue. Please review.
    Also opened a new MR.

  • Pipeline finished with Failed
    29 days ago
    Total: 837s
    #590699
  • Pipeline finished with Success
    29 days ago
    Total: 443s
    #590762
Production build 0.71.5 2024