Allow overriding output for password policy success/failure

Created on 26 January 2022, almost 3 years ago
Updated 7 April 2024, 7 months ago

Problem/Motivation

Right now the code is fairly hardcoded to output a table with the data regarding policies. Overriding this means overriding theming, in which the data is already geared towards table output.

Steps to reproduce

/

Proposed resolution

Either put the logic of converting password policy failure/success inside the theming functions, so you can theme based on the data (e.g. status is still a boolean), or even better, make the password policy output a Plugin based system where the output can be selected on a config form. This allows e.g. a list of constraints with a grey/green icon in front of it, an overview in one sentence, ... all to be added as plugins. This also allows each password policy to have a different output method.

Remaining tasks

Discuss the architecture on how this should work.

User interface changes

Frontend: no changes by default (default output stays the table)
Backend: extra configuration option on the password policy configuration to select the output method

API changes

Extra Plugin type.

Data model changes

Only configuration objects will change.

Feature request
Status

Postponed: needs info

Version

3.1

Component

Code

Created by

🇧🇪Belgium daften

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.

  • 🇧🇪Belgium al0a

    Reroll of patch for 4.0.x branch.

  • 🇺🇸United States jive01

    I get the following error when testing patch #6. :

    Fatal error: Class Drupal\password_policy\PasswordPolicyValidator contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Drupal\password_policy\PasswordPolicyValidatorInterface::buildPasswordPolicyConstraintsTableRows) in /app/web/modules/contrib/password_policy/src/PasswordPolicyValidator.php on line 16

  • Status changed to Needs work over 1 year ago
  • 🇧🇪Belgium al0a

    Fixed fatal error.

  • Status changed to Needs review over 1 year ago
  • Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year ago
    Waiting for branch to pass
  • Status changed to Needs work over 1 year ago
  • 🇬🇧United Kingdom Alina Basarabeanu

    Using Drupal Version 9.5.10 and password_policy 4.0.0 the patch applies cleaning but the markup generated has a duplicated div element with id password-policy-status
    See the screenshot attached.

  • Assigned to samit.310@gmail.com
  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 7.4 & MySQL 5.7
    last update about 1 year ago
    Waiting for branch to pass
  • 🇮🇳India samit.310@gmail.com

    Hi @Alina,

    The duplicated div element with id password-policy-status issue has been fixed, Please review again.

    Thanks
    Samit K.

  • Status changed to Postponed: needs info 7 months ago
  • 🇺🇸United States Kristen Pol Santa Cruz, CA, USA

    Thanks to everyone for the work on this issue.

    I'm going through all the 8.x issues.

    As the 8.x is no longer supported, I'm postponing this issue for now and need feedback as to whether or not this issue is relevant to 4.0.x.

    If it is, please reopen and change the version, make sure the issue summary is clear and complete, including steps to reproduce, and reroll the patch. If it's not, please close.

    If there is no response to this in a month addressing the above, it can be closed.

Production build 0.71.5 2024