Code logic will never reset password expiry

Created on 17 February 2021, over 3 years ago
Updated 7 April 2024, about 2 months ago

If the password is expired and the user tries to reset his password, the password will be reset successfully but the flag for expired password will not be removed due to undefined variables in the code.

$uid = $form_state->getValue('uid');

$form_state->getValue('uid'); is undefined since the uid in Drupal 8 isn't part of the form state object.

This should be replaced by:

// get the uid from user object.
$user = $form_state->getFormObject()->getEntity();
$uid = $user->id();

We are using this at different places, for instance with https://www.drupal.org/project/change_pwd_page .

Recent change here broke as ChangePasswordForm in the contrib module doesn't implement EntityForm.

🐛 Bug report
Status

Postponed: needs info

Component

Code

Created by

🇮🇳India ankitv18

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States Kristen Pol Santa Cruz, CA, USA

    Thanks to everyone for your work on this issue.

    As the 8.x is no longer supported, I'm postponing this issue for now and need feedback as to whether or not this issue is relevant to 4.0.x.

    If it is, please reopen and change the version and make sure the issue summary is clear and complete and includes concrete steps to reproduce. If it's not, please close.

    If there is no response to this in a month addressing the above, it can be closed.

  • 🇺🇸United States Kristen Pol Santa Cruz, CA, USA

    Tagging.

Production build 0.69.0 2024