After editing/creating a node, a user's organic groups (og.module) e-mail settings are reverted to zero. This issue has been tracked to the subscriptions.module; turning subscriptions.module off, makes the problem go away.

Please refer to http://drupal.org/node/87229#comment-146064

Comments

ricmadeira’s picture

Title: Saving nodes resets OG e-mail subscription settings » Creating nodes resets OG e-mail subscription settings
Priority: Normal » Critical

An update: since the subscriptions.module ceased sending out notices on node edits the issue with the og-module stopped ocurring there.

The problem still occurs, though, during node creation. When a user creates a node, that user stops receiving his OG e-mail notices because the related option in his profile is reset to "Never receive (OG) e-mails".

ricmadeira’s picture

Can anyone able look into this? It's a royal pain in the neck. :(

arthurf’s picture

I'm not able to duplicate this myself, but I don't have OG setup myself, so if you wouldn't mind testing some code out, try inserting

$user = user_load(array("uid" => $user->uid));

before the

user_save($user, array('subscriptions_subscribe' => $node->subscriptions_subscribe));

and let me know if that works for you...

thanks!

ricmadeira’s picture

Sorry for the delay; been away from drupal.org for a week. I've just tested your code addition and... there's no change in the abnormal behavior, sorry, the bug still persists.

ricmadeira’s picture

For reference, what seems to be happening is that that user_save in subscriptions.module is triggering this part of the og_user function/hook:

    case 'update':
      $sql = 'UPDATE {og_uid_global} SET og_email=%d WHERE uid=%d';
      db_query($sql, $edit['og_email'], $account->uid);
      $account->og_email = NULL;
      break;

Though I have no idea why or how to prevent it.

ricmadeira’s picture

Priority: Critical » Minor

Okay, so it turns out this might have been a bug with og.module after all, so don't bother with this... the maintainer says it's probably fixed now.

I'll have a look tomorrow and will close this bug if it turns out to be true.

Thanks to all!

ricmadeira’s picture

Project: Subscriptions » Organic Groups
Component: Code » og.module
Priority: Minor » Critical
Status: Active » Closed (fixed)

Finally fixed, thanks! It was the og.module all along.