Remove the hook implementation that unset password_policy_status key and add show_policy_table: false to the configuration of the default policy

Created on 11 January 2023, almost 2 years ago
Updated 22 January 2023, almost 2 years ago

Problem/Motivation

#2849271: Decouple display of policy table and policy validation
Password policy module added the ability to hide the status table using the policy configuration in version 8.x-3.2 .

Varbase Security module hides the table by unsetting password_policy_status key which will be undefined when the show_policy_table key in policy configuration is false.

And therefore it throws the following:

Warning: Undefined array key "password_policy_status" in _password_policy_check_constraints()
TypeError: Drupal\Core\Render\MainContent\AjaxRenderer::renderResponse(): Argument #1 ($main_content) must be of type array, null given

Steps to reproduce

Given that I created a new user using the default password policy
When visiting recent log messages
Then I see one warning and one error logged

Proposed resolution

  • Remove the hook implementation that unset password_policy_status key and add show_policy_table: false to the configuration of the default policy.
  • Add a hook update to update the password_policy.password_policy.default_policy in active configs

Remaining tasks

  • ✅ File an issue about this project
  • ✅ Addition/Change/Update/Fix to this project
  • ✅ Testing to ensure no regression
  • ➖ Automated unit/functional testing coverage
  • ➖ Developer Documentation support on feature change/addition
  • ➖ User Guide Documentation support on feature change/addition
  • ✅ Accessibility and Readability
  • ✅ Code review from 1 Varbase core team member
  • ✅ Full testing and approval
  • ✅ Credit contributors
  • ✅ Review with the product owner
  • ✅ Update Release Notes and Update Helper on new feature change/addition
  • ✅ Release varbase-9.0.11 , varbase_core-9.0.46

Varbase update type

  • ➖ No Update
  • ➖ Optional Update
  • ✅ Forced Update
  • ➖ Forced Update if Unchanged

User interface changes

Edit password policy - before the fix

Edit Normal user account before the fix

Edit Normal user account after only composer update

Navigate to "/update.php" or run drush updb

Edit password policy - After the fix with composer update and drush updb

Edit Normal user account after the drush updb

API changes

  • N/A

Data model changes

  • N/A

Release notes snippet

  • Issue #3332656 by RedwanJamous : Removed the hook implementation that unset password_policy_status key and add show_policy_table: false to the configuration of the default policy
🐛 Bug report
Status

Fixed

Version

9.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
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