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.
Currently the email_registration module only contains procedural code.
Functions like email_registration_unique_username and email_registration_cleanup_username could be moved to a separate service.
The patch attached, moves these 2 functions to a separate service.
Comment | File | Size | Author |
---|---|---|---|
#8 | move_username_functions-2831238-8.patch | 7.3 KB | JeroenT |
|
Comments
Comment #2
JeroenTRe-uploading patch to run tests.
Comment #4
JeroenTFixed coding standards + added email_registration.services.yml file.
Comment #6
JeroenTComment #8
JeroenTComment #9
andypostIdea looks good except name for service
helper really confusion and tells nothing about what this file for
Comment #10
JeroenTComment #11
JeroenT@andypost,
Any suggestion for the classname?
Comment #12
andypostnot yet( maybe better to split it more because clean-up can be a static class member
but this will just add more cpu usage for autoloading
So overall only db query could be in service but here's #551626: slow query in email_registration_user_login_validate
btw This conversion may have sense in terms of #657472: Add setting to allow users to login with email address or username but everything in hooks that means procedural...
So after thinking about it I'd better postponed that until #2402445: Implement object oriented form alters
Comment #13
andypostyep, let's postpone on OOP way for forms
Comment #14
andypostAs release 1.0 on a way, and we getting rid of legacy, it makes sense again
Comment #15
Grevil CreditAttribution: Grevil at DROWL.de commentedComment #16
Grevil CreditAttribution: Grevil at DROWL.de commented