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.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | user_registrationpassword-3500896.patch | 3.55 KB | mjb3141 |
| #2 | user_registrationpassword-3500896-1.patch | 2.32 KB | norbert-goco |
Issue fork user_registrationpassword-3500896
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
Comment #2
norbert-goco commentedI've created a patch for Drupal 11.
Comment #3
jeremyskinner commentedWe'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.
Comment #4
mjb3141 commentedUpdated Patch to perform a core version check.
Comment #7
joe huggansCreated 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.
Comment #8
trickfun commentedPatch #4 works on D11
Comment #9
fraserthompsonPatch #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?
Comment #10
fox mulder commented#4 solved the problem on core 11.3.3
Comment #11
vladimirausThanks @joe huggans.
Let's create new issue to fix tests.
Thanks everyone for your contributions.
Merging...