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.
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | password_policy-3054412-21.patch | 3.92 KB | mohammad-fayoumi |
| #17 | password_policy-3054412-17.patch | 3.32 KB | lamp5 |
Issue fork password_policy-3054412
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
Comment #2
mangy.fox commentedSupplied 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.
Comment #4
mangy.fox commentedAs 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.
Comment #5
acrosmanA 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.
Comment #6
rpayanmComment #8
lamp5@rpayanm your patch do not change the method of render policy summary table and additional breaks an ajax response.
Comment #9
lamp5I forgot to add a template file to the patch.
Comment #10
lamp5Reroll
Comment #12
anas_maw commentedGreat patch, working like a charm.
But please add {{ constraints_table }} as a default option in the template
Comment #13
anas_maw commentedActually 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.
Comment #15
jeroen_vreuls commented@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.
Comment #16
anas_maw commentedOh, sorry for this miss. Thank you
Comment #17
lamp5Reroll to the latest dev.
Comment #18
paulocsPatch looks really good.
Thanks @lamp5.
Comment #20
paulocsCreated a MR so its easier to commit it.
Comment #21
mohammad-fayoumiI'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.
Comment #23
paulocsComment #24
lamp5Finally! :)
Comment #25
mangy.fox commentedAmazing! Thanks everyone for running with this!
Comment #28
kristen polAdding credit for similar work on another issue: #3129576: Guidance when there are no constraints enabled