Closed (fixed)
Project:
Password Policy
Version:
8.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
28 Jun 2019 at 16:44 UTC
Updated:
9 Mar 2020 at 19:59 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jeroentStarted working on this issue. Had limited time so I did not make a lot of progress, but started grouping logic into separate functions and replaced the usage of $form_state with a variable that was declared earlier in the function.
The separate functions should also be converted to a service or multiple services imo.
Comment #3
jeroentComment #4
jeroentComment #5
aohrvetpv commentedLooks good!
This code (which you didn't change so far) is mystifying to me:
I'm not sure what that has to do with validation. It looks like it's turning a FALSE (checkbox unchecked) into a 0 for storage in the database or something. Seems like maybe it should be a submit handler thing, and not in the
_password_policy_constraints_validate(), but maybe I am missing the purpose. I'llgit blameit later and see if that yields any clues.Comment #6
jeroentHad some time to work on this issue. Created a new version and made 2 separate functions, one for validation and one for building the table.
Comment #7
jeroentComment #8
jeroentAllright, so tests are still passing. Did some manual testing of this patch and everything seems to work as before.
Next steps are:
Comment #9
jeroentMoved the code to a separate service.
Comment #10
jeroentRemoved $form, and $form_state from the validation and table methods.
Comment #11
jeroentComment #13
aohrvetpv commentedUnsure why it's failing tests, but this looks terrific!
Comment #14
jeroent@AohRveTPV,
The tests are failing because I made some changes to the validation plugins. Instead of passing an array $user_context, the user entity is now added. Changed the tests accordingly.
Comment #16
jeroentComment #17
aohrvetpv commentedHope to review/test this soon. Sorry for the delay, I had a problem with my Drupal development VM which I've now fixed.
Comment #18
aohrvetpv commentedUpdated patch to apply on latest code.
Sorry for the extreme delay on reviewing/testing this.
Comment #19
aohrvetpv commentedBad patch in #18. Working on it.
Comment #20
aohrvetpv commentedThis patch fixes some minor issues:
- Remove unused variable
$role_key.- Change some function comments to third-person singular per documentation standards.
- Remove erroneous
@returndocumentation.- Remove changes unrelated to this issue (e.g., reordering
usestatements).Note that interdiff versus #16 is not a pure interdiff because I first changed #16 to apply to latest -dev.
Comment #21
aohrvetpv commentedCouple more minor improvements:
- Add some missing function documentation.
- Improve variable name.
Comment #23
aohrvetpv commentedForgot to change variable name in a place in #21. Trying again.
Comment #24
aohrvetpv commentedCommitting without review/testing of #23, since it's minor changes versus #16 and the module is still in alpha.
Comment #26
aohrvetpv commented