Closed (cannot reproduce)
Project:
Organic Groups Notifications
Version:
7.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Jul 2012 at 21:55 UTC
Updated:
14 Jan 2016 at 00:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Yuri commentedComment #2
Yuri commentedSetting to major because the module does not work at all (for me), possibly related to this error.
Comment #3
Kirpaul commentedI have this issue as well
Comment #4
knsheely commentedI also get this error in the 7.x-1.x-dev branch.
Comment #5
kari.nies commentedSame error after enabling 7.x-2.x-dev. Running latest Organic Groups 7.x-2.0-beta1.
Any fix or workaround?
Comment #6
hanskuiters commentedI made a patch which works for me. I only use "notifications for entire group".
Comment #7
deanflory commentedI too get this error and the whole gid thing was messing with another module as well as it was replacing something like a db file type or something (can't remember off-hand now) which made that other module not work:
I haven't yet tested what this affects, but it seems pretty major and it would be great if it were fixed very soon.
I have not tested the patch as I can't tell from the information what it actually does. Does it actually fix the issue? Does it block the error from being displayed and thus not actually fix anything? Capono, can you provide more information on whether this patch is the fix or just an error alert blocker?
The original report was from July and it's now December............and the last release of this module was in May, so I'm guessing this module is dead and if there's no release in the next 2 weeks I'll just disable it, sadly.
Comment #8
hanskuiters commented@deanflory: The error you have is the same as in the opening post, so nothing new there. My patch doens't just block the error alert, but checks for $gid to be set. Should be sufficient, it was for me. I don't use the module anymore, switched to flag and rules to have more fine grained notifications. Maybe also a way to go for you?
Comment #9
deanflory commentedThanks capono for the tips. I was able to get the patch to work after altering the file name to "og_notifications_error_Undefined_variable_gid.patch" (no spaces). Will see now if the notices disappear.
Comment #10
pembeci commentedExtending the patch in #6 to account for the warning reported in #1782440: Warning with og_notification.
Comment #11
mxr576Here it is an another patch, that may solve the gid and subscription problems. Please take a look at it.
Comment #12
mxr576I've updated my prev patch to solve other related errors as well. Please test it!
Greetings, mxr576
Comment #13
edvanleeuwenTested and verified.
Comment #14
nicrodgersNone of the patches work for me with 7.x-2.x-dev :(
Comment #15
nicrodgersThis patch removes the gid notice error for me, using the latest dev version.
Comment #16
MatthijsG commented#15 worked for me. Is it in the latest dev?
Comment #17
edvanleeuwenI think #12 is a solution. I think #15 is only a work-around to prevent the error, not solving the issue.
Comment #18
edvanleeuwenIn recent tests I discovered that this has led to a flaw which sends out messages only to the last group subscribed. This has something to do with the double array_pop. See https://drupal.org/node/2276599.
Comment #19
lokapujyaDoes this problem still exist? I can't reproduce.
Comment #20
edvanleeuwenI have attached a patch which is the patch of #12 run against the latest dev. This fixes the problem for me.
Comment #21
lokapujyaWhat's needed here is the steps to reproduce. I do not get the error mentioned. Please make sure that you are on the latest code.
Comment #22
edvanleeuwenI am not able to reproduce this anymore either. In the mean time, core, OG, entity, OG Extras have been updated. Perhaps this has been solved in the combination of these modules.
Comment #23
edvanleeuwenShould we close this?
Comment #24
lokapujyaThanks for looking into this.
Comment #25
NewZeal commentedI'm getting the same error with latest version of og_notifications. There is definitely a problem with the function og_notifications_notifications_object_node() which doesn't filter out non group nodes. The error is caused by non group nodes.
Attached is a patch. I see that none of the previous patches have been implemented.
Comment #26
lokapujyaCan you please list the steps to reproduce the issue?
Comment #27
NewZeal commentedThe issue presents itself to users with the create subscriptions perms
Error is caused by set_group on non group affiliated content type in og_notifications.inc:
It originates from module notifications_content:
which fires a script in notifications.subscription.inc
Which fires a script in notifications.object.inc:
which invokes a hook in og_notifications:
The hook_notifications_object_node comes from a non og related module so it is the responsibility of og_notifications to check for whether or not a node belongs to a group or is a group node.
Comment #28
lokapujyaSo, another module is invoking the subscriptions hook (with a node that is not a group node) which is causing an error ? Wouldn't that be a bug in the other module?
This means that $node-type must be both a group type and a group content type; Is that the intended filter?
Comment #29
NewZeal commented1. No, as pointed out, the other module is a non og module so is not og cognisant. The function og_notifications_notifications_object_node invokes a hook from the notifications module which is a non-og module, so the responsibility lies with og_notifications and not the other module.
2. The filter should remove anything that fails both of these:
Which I believe the patch handles.
Comment #30
lokapujya1.) It seems like og_notifications implements hook_notifications_object_node(), I do not see where it invokes a hook from the notifications module. It appears that it is the notification module that passes the node in here:
I don't understand the problem enough to know whether that's notifications fault for sending a bad node. But maybe og_notifications should handle a bad node more robustly?
2.) The patch is saying (if its not a group type then return) and (if it's not group content type then return). I don't know the problem as well as you probably do, but it seems like it should OR not AND? in other words, if its a group or group content type then continue.
3.) Ideally, we should create a test for this. Not sure if you would want to do that. The module doesn't have any tests currently.
Comment #31
lokapujya#27 is a stack trace, but it would be helpful to have actual steps to reproduce. I know that it's kind of hard since this is integrated with many other modules.
Comment #32
NewZeal commented1. Yes, the function og_notifications_notifications_object_node() is fired from
So this is where it happens
We are not talking about "bad nodes" here, just nodes with no relation to og. The notifications module does not specifically handle og nodes but og_notifications_notifications_object_node() does.
2. It doesn't matter what the actual code in the patch is. You can use an Or if you like.
3. To replicate this, enable notifications_content, og_notifications and view a non og node in full view mode with a user that has create subscriptions perms.