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.
Created from #1775842: [meta] Convert all variables to state and/or config systems.
register_pending_approval_admin user.module
Comment | File | Size | Author |
---|---|---|---|
#15 | register_pending_approval_admin-1804926-15.patch | 3.61 KB | edrupal |
#15 | interdiff-7-15.txt | 2.35 KB | edrupal |
#7 | register_pending_approval_admin-1804926-7.patch | 3.63 KB | adammalone |
#4 | register_pending_approval_admin-1804926-1.patch | 1.4 KB | ela.m |
#1 | register_pending_approval_admin-1804926-1.patch | 1.39 KB | rbayliss |
Comments
Comment #1
rbayliss CreditAttribution: rbayliss commentedComment #2
alexpottThis is not precisely the same as it was in Drupal 7. It should be:
Comment #3
ela.m CreditAttribution: ela.m commentedComment #4
ela.m CreditAttribution: ela.m commentedJust added the "\n\n"s..
Comment #5
ela.m CreditAttribution: ela.m commentedComment #6
aspilicious CreditAttribution: aspilicious commentedI'm so confused about this. Where does this ever gets called? Can it be set in the UI? Where?
Comment #7
adammaloneIt's not actually set in the UI anywhere but after a bit of a trace I think I've found where it gets called.
register_pending_approval_admin is the mail key set when admin approval is required for user registration and the mail is going to the admin. This is called from the user module.
The drupal_mail function calls any functions which are of the type $module . '_mail' (user_mail function).
Within user_mail the subject and body are created by calling _user_mail_text with the $key (register_pending_approval_admin) followed by .subject or .body respectively.
_user_mail_text then does a config lookup with what is passed to it (register_pending_approval_admin.subject etc).
Perhaps then this should be a user configurable setting - to allow the email sent to admins when there is a new user awaiting approval to be customised?
I'm still relatively new to the whole CMI scene so my user_update_N function may not be correct. As far as I can tell though, that config does need to be set as it does get called.
Comment #8
edrupal CreditAttribution: edrupal commentedIt looks like this functionality is also being addressed by patch 809806-Register pending approval admin mails not configurable.patch in issue Register pending approval admin mails not configurable?.No idea which is the better approach.Please ignore, I was getting my versions confused.
Comment #9
edrupal CreditAttribution: edrupal commentedThe last section of the patch in #7 above failed to apply for me (the user.install changes)
Comment #10
adammaloneIt may need rerolling for updates to HEAD
Comment #11
alexpottThis function needs to migrate the variable from Drupal 7. There is a helper function to do this. See http://api.drupal.org/api/drupal/core!modules!user!user.install/function... for how to do this.
Actually this is a special case since the user.mail.yml in already updated by user_update_8006() so you can just add the two new variables to the conversion function.
Comment #12
alexpottComment #13
tstoecklerComment #14
YesCT CreditAttribution: YesCT commentedin case @edrupal or anyone else wants to try a reroll, here is the doc page for rerolls http://drupal.org/patch/reroll
Comment #15
edrupal CreditAttribution: edrupal commentedI've had a go at re-rolling the patch in #7. Also made the following changes:
Ed
Comment #16
adammaloneSetting the issue status to 'needs review' will trigger the review bot to test the patch.
Comment #17
BerdirLooks good to me. Does not have upgrade test coverage, but I don't think that we need explicit coverage for every single trivial variable.
Comment #18
YesCT CreditAttribution: YesCT commentedPer #17 removing tag
Note this is blocking #494518: Allow for custom user registration approval email address
Comment #19
YesCT CreditAttribution: YesCT commented#15: register_pending_approval_admin-1804926-15.patch queued for re-testing.
Comment #20
YesCT CreditAttribution: YesCT commentedSince it had been 5 days, and d8 is moving fast, I used the re-test link on the most recent patch to have to testbot test it again. That way we can reroll it if needed.
Comment #21
catchCommitted/pushed to 8.x, thanks!