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.
The function is too long and complicated.
Comment | File | Size | Author |
---|---|---|---|
#2 | password_policy-7.x-1.x-refactor_hook_user_login-2652394-2.patch | 2.99 KB | AohRveTPV |
|
Comments
Comment #2
AohRveTPV CreditAttribution: AohRveTPV commentedA first step: Move code duplicated throughout module to a new function,
_password_policy_load_active_policy_for_user()
.Comment #3
AohRveTPV CreditAttribution: AohRveTPV commentedThe majority of code in
hook_user_login()
pertains to expiration. Refactoring this code should be done in a way that minimizes duplication of code withpassword_policy_process_expirations()
.password_policy_process_expirations()
is also too long, and needs refactoring. Therefore, want to go ahead and refactor all expiration code.