- Issue created by @deepakkm
- Status changed to Closed: duplicate
10 months ago 8:48am 31 July 2024
Since PHP 8.1 has deprecating passing NULLs to many string manipulating functions and hence it throws TypeError: Drupal\Component\Utility\Html::escape(): Argument #1 ($text) must be of type string, null given when we save password length form.
1. install site using Drupal 11 ex : ./vendor/bin/drush si
2. log in to site
3. enable module using ./vendor/bin/drush en password_policy_blacklist password_policy_character_types password_policy_characters password_policy_consecutive password_policy_delay password_policy_history password_policy_length password_policy_username
4. Then go to /admin/config/security/password-policy and create a new policy and click save
5. In the Add constraint section add password character type and click save
6. Then add password character length and keep values to default and then click save and see the popup is not getting closed.
7. go to admin/reports/dblog and check the logs and you will see error
TypeError: Drupal\Component\Utility\Html::escape(): Argument #1 ($text) must be of type string, null given
1. go to PasswordLength.php and verify validateConfigurationForm why we are getting null value and replace it with empty.
Closed: duplicate
4.0
Code