Problem/Motivation

TypeError: Drupal\user\Form\UserPasswordForm::__construct(): Argument #5 ($userNameValidator) must be of type Drupal\user\UserNameValidator, Drupal\Core\TypedData\TypedDataManager given, called in /home/www-data/public_html/modules/contrib/user_registrationpassword/user_registrationpassword.module on line 524 in Drupal\user\Form\UserPasswordForm->__construct() (line 71 of core/modules/user/src/Form/UserPasswordForm.php).
_user_registrationpassword_user_pass_validate()

Steps to reproduce

In a Drupal 11 project go on the Reset your password (/user/password) page and submit the form.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

norbert-goco created an issue. See original summary.

norbert-goco’s picture

StatusFileSize
new2.32 KB

I've created a patch for Drupal 11.

jeremyskinner’s picture

We've also run into the same issue, however the solution in patch #2 isn't correct,.

Although this patch will fix the issue for Drupal 11, it will then cause failures under Drupal 10 which is a breaking change as user_registrationpassword supports both 10 and 11.

The correct way to handle this is to do a core version check and perform different calls depending on the core version. My colleague will provide an updated patch shortly.

mjb3141’s picture

Status: Active » Needs review
StatusFileSize
new3.55 KB

Updated Patch to perform a core version check.

joe huggans made their first commit to this issue’s fork.

joe huggans’s picture

Created MR with patch from #4, and corrected some phpcs stuff.

The 2 tests that are failing are already failing in the same points before this patch is applied, not sure what the module maintainers want to do about this? Do we need a new issue to fix these? Or is there one already open that I missed?

Tested in Drupal 10 and no error occurs when resetting password.

trickfun’s picture

Patch #4 works on D11

fraserthompson’s picture

Status: Needs review » Reviewed & tested by the community

Patch #4 works fine on the latest Drupal 11 release and fixes this issue. This has been hanging round for a while and it looks RTBC to me?

fox mulder’s picture

#4 solved the problem on core 11.3.3

vladimiraus’s picture

Version: 2.0.2 » 2.0.x-dev
Status: Reviewed & tested by the community » Fixed

Thanks @joe huggans.
Let's create new issue to fix tests.

Thanks everyone for your contributions.
Merging...

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.