Currently, the policy/constraint summary table shown to users is hard-coded in the policy validation helper function. This makes it impossible to customise in any meaningful way.

I propose creating a theme hook and template for the summary, to allow developers to customise the output of the validation data however they wish.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mangy.fox created an issue. See original summary.

mangy.fox’s picture

Assigned: mangy.fox » Unassigned
Status: Active » Needs review
StatusFileSize
new7.93 KB

Supplied patch adds theme hook and template for the summary table. By default it outputs the table the same as it currently is to maintain backwards compatibility with existing styling.

Status: Needs review » Needs work

The last submitted patch, 2: password_policy-summary_table_theming-3054412-2.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

mangy.fox’s picture

As far as I can tell, the test failures are due to this issue https://www.drupal.org/project/password_policy/issues/3032549 and other deprecated code.

acrosman’s picture

Issue tags: +Needs reroll

A bit more flexibility here would be welcome, but looks like now that #303249: Local Menu setting active menu to undesirable menus has been committed (and perhaps others), the patch now needs a re-roll.

rpayanm’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new7.34 KB

Status: Needs review » Needs work

The last submitted patch, 6: 3054412-6.patch, failed testing. View results

lamp5’s picture

Status: Needs work » Needs review
StatusFileSize
new7.05 KB

@rpayanm your patch do not change the method of render policy summary table and additional breaks an ajax response.

lamp5’s picture

StatusFileSize
new7.82 KB

I forgot to add a template file to the patch.

lamp5’s picture

StatusFileSize
new3.45 KB

Reroll

Status: Needs review » Needs work

The last submitted patch, 10: password_policy-3054412-9.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

anas_maw’s picture

Great patch, working like a charm.
But please add {{ constraints_table }} as a default option in the template

anas_maw’s picture

Status: Needs work » Needs review
StatusFileSize
new2.56 KB

Actually the latest patch needs a minor fixes as it's not updating the constraint status, here is an updated one which will fix the issue.

Status: Needs review » Needs work

The last submitted patch, 13: password_policy-3054412-13.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

jeroen_vreuls’s picture

StatusFileSize
new3.32 KB

@Anas_maw
Your last patch is missing the template file, causing a fatal error when it is not in the theme. Attached patch has a default template.

anas_maw’s picture

Status: Needs work » Needs review

Oh, sorry for this miss. Thank you

lamp5’s picture

StatusFileSize
new3.32 KB

Reroll to the latest dev.

paulocs’s picture

Status: Needs review » Reviewed & tested by the community
Related issues: +#3238787: Plan for Password Policy 8.x-3.1

Patch looks really good.
Thanks @lamp5.

paulocs’s picture

Created a MR so its easier to commit it.

mohammad-fayoumi’s picture

StatusFileSize
new3.92 KB

I've tested the patch on the dev version and it works well, Thank you :)

But it didn't apply to the latest stable release 8.x-3.0, I've rerolled the patch to work on this version 8.x-3.0.

  • paulocs committed 782ab61 on 8.x-3.x
    Issue #3054412 by lamp5, paulocs, mangy.fox, Anas_maw, jeroen_vreuls,...
paulocs’s picture

Status: Reviewed & tested by the community » Fixed
lamp5’s picture

Finally! :)

mangy.fox’s picture

Amazing! Thanks everyone for running with this!

Status: Fixed » Closed (fixed)

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

kristen pol’s picture

Adding credit for similar work on another issue: #3129576: Guidance when there are no constraints enabled