Undefined index in user edit form

Created on 26 October 2018, over 6 years ago
Updated 7 April 2024, about 1 year ago

After user form submission, I got:

Undefined index: value in _password_policy_constraints_validate() (line 169 of modules/contrib/password_policy/password_policy.module).

Code at that point in password_policy.module:

...
168  $expiration = $form_state->getValue('field_password_expiration');
169  if (!is_null($expiration) && $expiration['value'] === FALSE) {
170    $form_state->setValue('field_password_expiration', ['value' => 0]);
171  }
...

$expiration['value'] is undefined because the field needs also the delta. So it should be read from $expiration[0]['value']

πŸ› Bug report
Status

Postponed: needs info

Version

3.0

Component

Code

Created by

πŸ‡ͺπŸ‡ΈSpain manuel.adan 🌌

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. If it's not, please closed as "won't fix".

    If there is no response to this in a month addressing the above, it can be closed as "won't fix".

  • Status changed to Closed: won't fix about 1 month ago
  • πŸ‡«πŸ‡·France prudloff Lille

    I can't reproduce with 4.0.3.
    $expiration is always an array with a value key.

Production build 0.71.5 2024