Download & Extend

Creating nodes resets OG e-mail subscription settings

Project:Organic groups
Version:4.7.x-1.x-dev
Component:og.module
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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

#1

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".

#2

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

#3

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!

#4

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.

#5

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.

#6

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!

#7

Project:Subscriptions» Organic groups
Version:4.7.x-1.x-dev» 4.7.x-1.x-dev
Component:Code» og.module
Priority:minor» critical
Status:active» closed (fixed)

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