Needs work
Project:
Password Policy
Version:
4.0.0
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
2 Oct 2021 at 05:17 UTC
Updated:
28 Jan 2026 at 14:12 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
joshua1234511Comment #4
joshua1234511Password policy email form added at /admin/config/system/password_policy/emails
Configuration added "password_policy.email"
Comment #5
joshua1234511Comment #6
joshua1234511Moving the the password policy emails as they are another user account-related emails, they should come in the central place for email templates: /admin/config/people/accounts
Comment #10
joshua1234511Moving the the password policy emails as they are another user account-related emails, they should come in the central place for email templates: /admin/config/people/accounts
Comment #13
joshua1234511Comment #15
joshua1234511Updated Render() method to tostring getGeneratedLink().
Comment #16
paulocsthis looks a nice feature and it will be welcome.
Comment #17
huriellopes commentedSteps performed:
(1) Module installed
(2) Reproduction of the problem.
(3) Patch applied.
(4) Code review on changes.
(5) Retested with patch, issue resolved.
Comment #18
paulocsThis issue is not ready yet because the tests are failing.
Comment #20
hmendes commentedComment #21
joshua1234511Retested the patch after changes from @hmendes.
Working as feature expected.
@huriellopes please reconfirm the same.
Comment #22
danthornePatch 21 not working with latest dev
Comment #23
danthorneComment #24
gquisini commentedI'll try to work on it
Comment #25
gquisini commentedI basically made a reroll from #21 patch.
Comment #26
2gendevs commentedPatch from #25 fails to apply.
Patch from #21 breaks the form at /admin/config/people/accounts for the other emails. i.e. you can't save "welcome (new user created by administrator) or any of the other non-password policy emails. No error messages or success message. It just doesn't save. Removing the patch allows me to save the emails again.
Tested on Drupal 9.4.5.
Fixing it by changing the following in the patch password_policy_form_user_admin_settings_alter() function (password_policy.module)
to
Comment #27
2gendevs commentedMy fix from above, should be applied after patch 21.
Comment #28
lucasbaralmi will work on this.
Comment #29
lucasbaralm(Still working in it as the patch failed to apply) Basically, I made some minor tweaks to patch #25 to be applicable in the actual branch and merged the changes from #27 into it.
Comment #30
lucasbaralmTrying to make patch #29 applicable with branch 3240363-module-to-provide. It work locally but failed to apply on remote.
Comment #31
lucasbaralmComment #32
sophiavs commentedI'll analyze the error in the patch.
Comment #33
sophiavs commentedI united all the patches and analyzed then, some of the patchs was missing parts from other patchs and that caused the patch failed to apply. Also, i couldn't find the file PasswordPolicyGeneralForm.php is in the dev, so i removed those parts from the patch
Comment #35
paulocsPasswordPolicyGeneralForm.phpwas removed in #2877040: Remove dependency on CToolsIt still needs work because tests are failing
Comment #36
sophiavs commentedSorry, i had made a change to test and created the patch without changing back.
That is the correct one.
Comment #37
sophiavs commentedI don't know why the new file isn't saved on the diff
Comment #39
sophiavs commentedComment #40
victorml commentedI tested and reviewed it, and everything works fine.
Tests are passing too.
Comment #41
l-laziz commentedThe feature/issue is still relevant for 4.x version and the patch #39 applies to 4.0.0 module version cleanly.
Comment #42
l-laziz commentedComment #43
shaunlaws commentedThis patch does apply cleanly to 4.0.0, but caused a failure when I upgraded a site from D9 to D10.1.4. When running 'drush updb' it failed in password_policy_update_8305 at:
$config_path = drupal_get_path('module', 'password_policy') . '/config/install/password_policy.email.yml';because drupal_get_path was removed from D10 - https://www.drupal.org/node/2940438.
I suppose one upgrade path would be to apply the patch to the D9 site and run 'drush updb', but the path of least resistance for me was to re-roll the patch in #39 to change the failing statement to one which is compatible with both D9 and D10:
$config_path = \Drupal::service('extension.list.module')->getPath('password_policy') . '/config/install/password_policy.email.yml';I have only tested the patch when running password_policy_update_8305 on a D10 site but it *should* work on D9 also.
Comment #44
gregglesThis feature seems pretty unrelated to the purpose of the module.
Comment #45
simon-pAs the person who submitted issue https://www.drupal.org/project/password_policy/issues/3292927 I have to say it it seems very related.
Here is an example of what our currently staff receive:
The text 'your password will expire soon' does not give any indication of what password needs changing, or even that it is a website password. If the person receiving it does not know which password needs changing they are unlikely to do it, which defeats the purpose of the module.
Given that password reset reminders are a commonly used in spam, people are going to ignore the email if there is no specific text that helps them identify that the email is genuine.
Comment #46
simon-pComment #47
kristen polAssigning to myself as I'm reviewing/merging ready RTBC fixes/updates over the next few days.
Comment #48
kristen polThanks everyone for working on this issue. I haven't read all the comments yet but regarding #44:
The email feature is already part of this module, so making the text configurable like other core user emails makes sense to me.
There are lot of patches and MRs updates so this is a bit hard to follow.
For example, it doesn't look like the latest patch included the fix noted in #26.
I'll look a bit more but this probably will need more work.
Comment #49
kristen polI've reviewed the code, but didn't test anything. Moving back to "needs work" based on the following:
Ignore my note above about #26. I thought the logic was reversed, so it looks okay.
One thing I noticed was that core uses
type: mailin the schema, but that's not used in this code, e.g.Some other observations:
Nitpick: Inconsistent use of
emailvsmailthroughout code. Ideally, be consistent in usage throughout this code or be consistent with core naming if that is different.This label needs to change because this config object has both the "
expired" and "to expire" info.Nitpick: Should be in alphabetical order.
Wrong description.
Empty space after
$link. Is that expected?Same.
Comment #50
sgoodwin commentedThis patch failed to apply with version 4.0.2. So this is the reroll of the patch 2023_09_21_3240363-40.patch.
Comment #52
bdunphy commentedPatch in comment #50 works well so far on 4.0.3. Thank you to all who worked on this.
Comment #54
codebymikey commentedAttached static patch of the current MR, with improved compatibility with Drupal 11