Download & Extend

Group membership denial email is not sent when using og_notifications

Project:Organic groups
Version:6.x-2.x-dev
Component:og_notifications
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

I am observing this in 6.x-1.3 and have found the missing code and fixed it. I have not upgraded to 6.x-1.4 but have downloaded it and do not see the fix present so I am assuming the problem is still present in 6.x-1.4. If not, my apologies.

og.module invokes the 'og' hook for user approve actions and user denial actions. The action parameter sent for the former is 'user approve' for the former and 'user deny' for the latter. This can be seen in the functions og_approve and og_deny in og.module.

In og_notifications.module the 'og' hook is implemented as og_notifications_og and has the following code:

function og_notifications_og($op, $gid, $uid, $args) {
  switch ($op) {
    case 'user insert':
      $account = user_load(array('uid' => $uid));
      og_notifications_user_autosubscribe($account, $gid);
      break;
    case 'user delete':
      $account = user_load(array('uid' => $uid));
      og_notifications_user_unsubscribe($account, $gid);
      break;
    case 'user request':
      // This and other notifications related ops drop down to the same case.
      // These different ops have been provided for consistency and flexibility
      // during use by other modules.
    case 'user approve':
    case 'admin create':
    case 'admin new':
    case 'user broadcast':
      $destinations = is_array($uid) ? $uid : array($uid);
      foreach ($destinations as $uid) {
        notifications_lite_send($uid, $args['subject'], $args['body']);
      }
      break;
  }
}

There is no case for 'user deny' and so og_notifications is not alerted to this event and does not send a denial message. Adding:

    case 'user deny':

to the last block of case statements has resolved this for me. I'll make and post a patch later today.

Comments

#1

Status:active» needs review
AttachmentSizeStatusTest resultOperations
618094.patch507 bytesIgnored: Check issue status.NoneNone

#2

+1 for this. Seems like one of those "Doh!" bugs.

#3

Status:needs review» reviewed & tested by the community

Thanks for the patch, worked for me. Changing status to push it to the release.

#4

Thanks for the sleuthing. Turns out that this line of code needs to be added to 2.1, too!

#5

Version:6.x-1.4» 6.x-2.x-dev
Status:reviewed & tested by the community» fixed

http://drupalcode.org/project/og.git/commit/0cffadf

#6

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here