Possible regression introduced by "change own username" fix

Created on 19 May 2020, over 4 years ago
Updated 13 October 2023, about 1 year ago

My gut says that the merged fix in #3034828 may introduced a regression. Should not it is being checked if if (!($form_state->getFormObject()->getEntity()->id() === $account->id() && $account->hasPermission('change own username')) || $account->hasPermission('administer users'))) {, iow the user who is checking the form is the user that is belongs? Maybe some extra handling is required for anonymous user too, because this form is being called on the user registration form too, if I am not mistaken. (See contact_form_user_form_alter()).

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇭🇺Hungary mxr576 Hungary

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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.

Production build 0.71.5 2024