Hi,

The table the is returned via _password_policy_constraints_table() gives a table of each constraint and its status:

Table screenshot

It would be great if each row could have its own pass or fail class added so that this can be themed accordingly on the front end.

Cheers

Tom

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

blacklabel_tom created an issue. See original summary.

blacklabel_tom’s picture

Issue summary: View changes
FileSize
289.62 KB
blacklabel_tom’s picture

Assigned: Unassigned » blacklabel_tom
blacklabel_tom’s picture

Version: 8.x-3.0-alpha4 » 8.x-3.x-dev
Status: Active » Needs review
FileSize
1.11 KB
mangy.fox’s picture

I've actually done some modifications so that the password status is properly themeable. I haven't had time to tidy it up and submit it yet, but you can have my WIP patch.

blacklabel_tom’s picture

Thanks Rob, I'll give it a bash!

Sophie.SK’s picture

Status: Needs review » Reviewed & tested by the community

Gonna go ahead and mark this as RTBC as we're using this patch on our site and have no problems with it :) Worth noting that Rob's patch goes above and beyond the original report from Tom.

Robert Castelo’s picture

Here's a patch based on #5 for an alternative solution that might be closer to what most projects would want:

* Only displays fail message rows
* Only displays the actual fail message

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 8: password_policy_message.patch, failed testing. View results

mangy.fox’s picture

Thanks Robert Castelo. I'm not sure if this is the place to be deciding what most projects would want. Happy to hear people's opinions on whether this should be changed though.

The point of #5 was to make it easier for devs to change the output to whatever they wanted. I intentionally kept the default output the same as the existing code so that there were no unexpected changes for users/clients.

I also can't see the default template in your patch.

Robert Castelo’s picture

Sorry, ignore my patch in previous post, please try this one instead.

Robert Castelo’s picture

"I'm not sure if this is the place to be deciding what most projects would want."

Agreed - I'll rephrase my earlier comment to "for those looking for a more minimalist password message".

Robert Castelo’s picture

New patch that also changes messages header to "Password Security Requirements", and empty/passed message to "All requirements passed.".

mangy.fox’s picture

Assigned: blacklabel_tom » Unassigned
Status: Needs work » Closed (duplicate)
Related issues: +#2858693: Add css class for styling the pass/fail

Closing this as a duplicate of https://www.drupal.org/project/password_policy/issues/2858693 which is already fixed.

I will open a new issue for my theming changes.