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.
This module currently throws an error on user creation with OG Invite.
In role_change_notify_user_presave() on line #156 there is a check for $account->uid > 0. But OG Invite only returns:
object(stdClass)#119 (1) {
["is_new"]=>
bool(true)
}
Could there be an extra check on this, like change this:
if ($account->uid > 0 && array_key_exists('roles', $edit)) {
to this:
if ($account->is_new == FALSE && $account->uid > 0 && array_key_exists('roles', $edit)) {
Comment | File | Size | Author |
---|---|---|---|
#2 | role_change_notity.patch | 590 bytes | HansKuiters |
Comments
Comment #1
rfayA patch is welcome. I'd also be happy to give you privileges on this module, as I haven't (ever) used it, so it gets no love.
You should also consider using Rules, which gives far more flexibility.
Comment #2
HansKuiters CreditAttribution: HansKuiters commentedThanks. But I'm no great developer, not that familiar with git and I'm not planning to upgrade to developer status here at Drupal.
Patch is attached.
Comment #3
rfayGood enough to make a patch that passes testing the first time... Ready for the big time!
@capono++
Comment #4
rfayI think this would improve it, so it doesn't stumble on various items in the account object being unset:
if (empty($account->is_new) && !empty($account->uid) && array_key...
Comment #5
HansKuiters CreditAttribution: HansKuiters commentedHaha, only thanks to OSX, Terminal and diff.
Comment #6
rfayIf you're interested... I will happily help you with any git roadblocks you may come across. And there's lots of good info. Most of it is pretty easy. Works great on the mac.