Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Password Policy depends on the CTools module for one single configuration form in the backend: PasswordPolicyWizard
. This has the drawback that I now have tons of unnecessary CTools code running in my project, and I get all its bugs for free.
1) Remove ctools depedency
2) Attach screenshots from the changes.
3) Check if the new form to create/edit the Password Policy is user-friendly.
Comment | File | Size | Author |
---|---|---|---|
#57 | MR-37-password-policy-edit-2.png | 125.02 KB | lucassc |
#57 | MR-37-password-policy-edit-1.png | 145.25 KB | lucassc |
#57 | MR-37-password-policy-add-1.png | 132.26 KB | lucassc |
#57 | 8.x-3.x-password-policy-edit-3.png | 100.55 KB | lucassc |
#57 | 8.x-3.x-password-policy-edit-2.png | 116.3 KB | lucassc |
Issue fork password_policy-2877040
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
AohRveTPV CreditAttribution: AohRveTPV commentedShould probably remove the 8.x-1.x branch too...
Comment #3
AohRveTPV CreditAttribution: AohRveTPV commentedIt seems like it'd add a fair amount of complexity to do as you suggest: Use a wizard if CTools is installed and fall back to a single form otherwise.
The CTools entity form wizard API requires specifying a form for each step. So falling back to a single form would seem to require each of the three existing forms having methods that can be called to return the contents of that form. Then you could have a new form class that calls each of those methods to put together the entire form.
In my opinion the root problem is CTools is monolithic, too large a dependency. We should be able to place a dependency on a module/library that provides only a form wizard, instead of placing a dependency on all of CTools. But I don't think there exists such an option.
I think adding fallback for no CTools would be unnecessary complexity in this module (since it seems fairly complex as I described above). I think the better choices would be to (1) find/create/wait on a lighter-weight dependency that provides a form wizard, or (2) abandon wizard and just use single form to eliminate the CTools dependency.
Just my initial thoughts, I've hardly done D8 development so I defer to nerdstein.
Comment #4
pfrenssenMaybe we can split off the configuration UI in a separate submodule, similar to the Views UI module? Would that be easier?
The UI submodule can then have a dependency on CTools, and we can deploy the config to production without having to enable the UI and CTools. Nobody has any business changing configuration settings on a live production instance anyway.
FYI I'm currently working around it by simply removing the dependency from the info.yml file.
Comment #5
AohRveTPV CreditAttribution: AohRveTPV commentedI like that idea. Other modules have that design too, like Rules. Turning off the configuration UIs in production reduces attack surface.
Comment #6
DanielVezaThis hasn't been updated in 4 years. Lets review if we can do this better & without ctools.
We maintain the distribution Sector, which needs ctools just because of this module. I'd love to be able to remove ctools.
Comment #7
paulocsComment #8
paulocsI created a submodule called password_policy_ui and removed the ctools dependecy.
Comment #10
paulocsFixing remaining tests.
Comment #11
larisse CreditAttribution: larisse at CI&T commentedHi! The patch breaks my site.
I have some policies in my site, and after that I applied the patch, it breaks my site.
You can see the error in the image.
obs: when I apply the patch I get a warning (I will let the image too).
Comment #12
larisse CreditAttribution: larisse at CI&T commentedComment #13
paulocsHi @larisse!
Thanks for the review. The problem is the menu link in
password_policy.links.menu.yml
.I wrote a new patch.
Cheers,
Paulo.
Comment #14
larisse CreditAttribution: larisse at CI&T commentedHi @paulocs! Now the patch works correctly. Changing to RTBC.
I still receive the follow warning when I apply the patch.
2877040-13.patch:24: new blank line at EOF.
+
warning: 1 line adds whitespace errors.
Comment #15
paulocsThere are some code standard problems #13...
We need to address it before commit and we should have more people testing it, as this is a big change.
I wonder if @DanielVeza can test it as well as he recently commented in the issue.
Comment #16
DanielVezaJust for clarity - Does the Password policy UI module need ctools or has that been 100% removed? If it's been removed I'm a big fan!
Comment #17
paulocsThe dependency was completely removed.
Comment #18
hmendes CreditAttribution: hmendes at CI&T commentedAdding a new patch to fix coding standards from #13 and add a hook_update to install the password_policy_ui.
Please review.
Comment #19
hmendes CreditAttribution: hmendes at CI&T commentedAdding a new patch. No interdiff as previous patches no longer apply.
Comment #21
hmendes CreditAttribution: hmendes at CI&T commentedTrying to fix the errors reported.
Comment #22
hmendes CreditAttribution: hmendes at CI&T commentedChanging to Needs review as it passed the tests.
Comment #23
hswong3i CreditAttribution: hswong3i commentedPatch reroll via 8.x-3.x-dev
Comment #25
huriellopes CreditAttribution: huriellopes at CI&T commentedI work in the issue!
Comment #26
huriellopes CreditAttribution: huriellopes at CI&T commentedComment #27
paulocsComment #29
hswong3i CreditAttribution: hswong3i commentedComment #30
hmendes CreditAttribution: hmendes at CI&T commentedComment #31
KarimBou CreditAttribution: KarimBou commentedWe're having those dependencies issues on D9.3 aswell after upgrading
Comment #32
matheusmaciel CreditAttribution: matheusmaciel at CI&T commentedI'll try to work on it!
Comment #33
matheusmaciel CreditAttribution: matheusmaciel at CI&T commentedI'll no longer be able to work on this issue.
Comment #34
andregp CreditAttribution: andregp at CI&T commentedI'm working to find out why the test PasswordExpiredEmailSendTest is failing and try to fix it.
I'm also going to rebase the MR to resolve the current unmergeable state.
Comment #35
andregp CreditAttribution: andregp at CI&T commentedI finally managed to fix the failing test (with help from @paulocs) and rebased the MR to make it up to date.
The problem on the failing test was that some elements were added to the PasswordPolicy edit form in the main branch, but were removed on the previous reroll so I had to add it back to the form.
Comment #36
bkendally CreditAttribution: bkendally at CI&T commentedI can review.
Comment #37
bkendally CreditAttribution: bkendally at CI&T commentedComment #38
WagnerMelo CreditAttribution: WagnerMelo at CI&T commentedHi, i'll try review it. XD
Comment #39
WagnerMelo CreditAttribution: WagnerMelo at CI&T commentedHi, i tried made this review, but i found a bug in the module.
I couldn't be able to test the functionality of module, because when i tried create a new password constraint, the site never save the new constraint. When i clicked on save button, only refresh but don't save, it only was able to save new constraints when i applied the patch sended by @paulocs. That created a new module to remove the dependecy on ctools, and talk with him about this review.
He asked me to try use the module without his patch, creating news constraints, and after that apply the patch to see how this new sub-module works, beacuse one of functionalitys was make a backup of the existents constraints, beacuse if don't had this functionality, who already use the module went lose yours existents constraints.
So, because that, i coudn't made the review this issue, cause i could not test the module.
ps: i don't know exactly if i need change this issue to need work, so i'll let how are.
Comment #40
elberComment #41
elberComment #42
elberHi I was able to apply the André's MR and with it the module is working normally.
I was able to create a new policy for my passwords.
The module now doesn't need the ctools module (this dependencies were removed correctly).
Comment #43
sergiurthe composer.json file still requires ctools https://git.drupalcode.org/issue/password_policy-2877040/-/blob/2877040-...
Comment #44
elbersorry I forget to review it.
Comment #45
elberHi I just made the change that @segiour mentioned.
Comment #46
lucasscComment #47
lucasscHi!
I removed remaining references to ctools. With this I believe the tests will pass too.
Please, review this.
Comment #48
elberComment #49
elberHi I was able to apply the @lucasssc's changes.
I added all the policies possible after that I create a new password for my user and I verified that all policies are working good.
I didn't find the ctools dependency on this module.
Comment #50
kim.pepperThis issue splits out a new module
password_policy_ui
and does a whole lot of other seemingly unrelated code changes. The issue summary needs an update with all the changes, including UI changes (screenshots?) to make it easier to review.Comment #51
paulocsI think we should focus first on remove the ctools dependency. Thank we can create the
password_policy_ui
if it's necessary. I'll work on it.Comment #54
paulocsJust created MR 37. It is not ready yet. I have to do more manual tests and clean the code, so leaving in NW for now. I have unassigned my self if someone wants to work on it during the weekend.
Anyway next week I'll work more on this issue :)
Comment #55
paulocsPlease review it :)
Comment #56
lucasscComment #57
lucasscI applied the MR !37 locally to 9.4.x and it worked for me, so I checked the Issue summary and verified that:
1) Remove ctools depedency
Done! ctools depedency was completely removed.
2) Attach screenshots from the changes.
Done, ScreenShots (SS) attached:
- files with 'MR-37' prefix are SS from source branch;
- files with '8.x-3.x' prefix are SS from target branch;
- files with 'add' in name are SS from the new form to create Password Policy;
- files with 'edit' in name are SS from the new form to edit Password Policy.
3) Check if the new form to create/edit the Password Policy is user-friendly.
It's my first time using the module and the new form to create/edit Password Policy, IMHO is super user-friendly!
Also, I found a few coding standards problems and fixed it.
Please, review this.
Comment #59
paulocsComment #60
paulocs