- 🇩🇪Germany Anybody Porta Westfalica
Confirming the issue for 2.0.x!
/user/registeris broken - 🇯🇴Jordan Rajab Natshah Jordan
I'm with unselected.
Tested with Drupal 9 and 10 under PHP 8.1I confirm the issue in both
Drupal 9
When"Users must enter a password on registration. This is disabled if e-mail verification is enabled above."is selected for"Password handling"The website encountered an unexpected error. Please try again later. TypeError: Drupal\Core\Form\FormState::setValueForElement(): Argument #1 ($element) must be of type array, null given, called in /var/www/html/test/drupal9genpass/web/modules/contrib/genpass/genpass.module on line 270 in Drupal\Core\Form\FormState->setValueForElement() (line 79 of core/lib/Drupal/Core/Form/FormStateValuesTrait.php).Drupal 10
The website encountered an unexpected error. Please try again later. TypeError: Drupal\Core\Form\FormState::setValueForElement(): Argument #1 ($element) must be of type array, null given, called in /var/www/html/test/drupal10genpass/web/modules/contrib/genpass/genpass.module on line 270 in Drupal\Core\Form\FormState->setValueForElement() (line 79 of core/lib/Drupal/Core/Form/FormStateValuesTrait.php).When the
"Require email verification when a visitor creates an account"checkbox is checkedNew users will be required to validate their email address prior to logging into the site, and will be assigned a system-generated password. With this setting disabled, users will be logged in immediately upon registering, and may select their own passwords during registration.
This is disabled if e-mail verification is enabled above.
Users must enter a password on registration.
But the field is hidden in this case.
Should it be hidden? or should it be visible? and only generate if the user did not add a password - 🇯🇴Jordan Rajab Natshah Jordan
Mmmm, warning too when saved at the Account setting page and unselect to the default config.
- First commit to issue fork.
- last update
over 2 years ago 2 pass - @elc opened merge request.
- Status changed to Needs review
over 2 years ago 3:33pm 19 August 2023 - 🇦🇺Australia elc
The module isn't following the logic path it says that it will:
It very much makes sense that genpass should not be involved in registration form if e-mail verification is enabled, as there is no password field to adjust.
The presence of the "pass" form item appears to be a good indication, and also the direct cause of the error when it is missing.
This needs to be ported to 8.x-1.x too.
- last update
over 2 years ago 1 pass - 🇦🇺Australia elc
Patch for the 8.x-1.x branch.
MR!10 is for the 2.x branch.
- 🇮🇳India NivethaSubramaniyan
This issue exits and the given patch works fine. I have detailed the steps and attached the screenshots for the reference.
Steps to reproduce.
1) Enabled genpass:^2.0@alpha in drupal 10.1
2) Go to the account settings page /admin/config/people/accounts
3) Enable the option: Users must enter a password on registration. This is disabled if e-mail verification is enabled above. and save it
4) Logout as admin and try registering as a new user
5) After registering you will get the error message:
TypeError: Drupal\Core\Form\FormState::setValueForElement(): Argument #1 ($element) must be of type array, null given, called in /var/www/html/web/modules/contrib/genpass/genpass.module on line 270 in Drupal\Core\Form\FormState->setValueForElement() (line 79 of core/lib/Drupal/Core/Form/FormStateValuesTrait.php). [ Attached screenshot].
6) After applying the patch , it fix the issue. - Status changed to Fixed
over 2 years ago 12:09pm 28 August 2023 - 🇦🇺Australia elc
This works quite well at preventing the error by not attempting to run code against a non-existent "pass" form item.
What it has shown up, is that GenPass doesn't get involved in generating a password in a number of situations - the issue 📌 Add PasswordGeneratorInterface based service. Remove hook_password Fixed is looking to address this.
Automatically closed - issue fixed for 2 weeks with no activity.