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 password policy - before the fix

Edit Normal user account before the fix
Edit Normal user account before composer update

Edit Normal user account after only composer update
Edit Normal user account after only composer update

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

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

Edit Normal user account after the 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

Comments

RedwanJamous created an issue. See original summary.

redwan jamous’s picture

StatusFileSize
new1.5 KB

Patch provided. Update is needed to set show_policy_table to false.

rajab natshah’s picture

Status: Active » Needs work

Nice
They had the show_policy_table config settings committed and released then.
Let us add a hook update to update the password_policy.password_policy.default_policy in active configs for old projects.

rajab natshah’s picture

Assigned: Unassigned » rajab natshah
Status: Needs work » Active
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Title: Fix Warning: Undefined array key "password_policy_status" in _password_policy_check_constraints() » Remove the hook implementation that unset password_policy_status key and add show_policy_table: false to the configuration of the default policy

  • Rajab Natshah committed dfd39a66 on 9.0.x
    Issue #3332656: Add a hook update to update the password_policy....

rajab natshah’s picture

Assigned: rajab natshah » mohammed j. razem
Issue summary: View changes
Status: Active » Needs review
Issue tags: +varbase-9.0.10, +varbase_core-9.0.46
rajab natshah’s picture

Assigned: mohammed j. razem » Unassigned
rajab natshah’s picture

Status: Needs review » Fixed
rajab natshah’s picture

Issue summary: View changes
Issue tags: -varbase-9.0.10 +varbase-9.0.11
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes

✅ Released varbase_core-9.0.46

rajab natshah’s picture

Issue summary: View changes

✅ Released varbase-9.0.11

Status: Fixed » Closed (fixed)

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