Closed (fixed)
Project:
OG Event
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Nov 2010 at 10:11 UTC
Updated:
3 Apr 2011 at 15:31 UTC
In certain cases theme_og_event_subscribe_message() is returning (at wrong) a "This event is closed" message instead of subscribe | unsubscribe link.
I found out that the problem is in og_event.module that does this call:
$groups = og_get_node_groups($node);
without checking whether $node is a real node object or just a nid.
In the second case, og_get_node_groups() will return an empty array, causing the following if()s to fail.
I fixed this by adding this piece of code:
if (is_numeric($node)) {
$node = node_load($node);
}
at line 385 of og_events.module.
I'm also attaching a patch for this.
| Comment | File | Size | Author |
|---|---|---|---|
| og_event_load_node.patch | 79 bytes | -redShadow- |
Comments
Comment #1
pounardThanks, I will review as soon as I can.
Comment #2
pounardHello again!
I did some cleanup in code, also performance improvements and made the Event module dependency optional. Therefore, I could have created new regressions. A new dev release will shortly appear (may be in the next 12 hours).
Your bug probably is fixed in this dev release, your patch is good but I made some changes in functions signature and fixed the bug in another way.
You can test it, on a development working copy. If you do so, please check that you experience no visible regression (it shouldn't, but I still didn't wrote SimpleTest tests, as soon as I will do, I also will release a new stable release).
Thank you for reporting, please give me feedback.
Comment #3
pounardFixed and commited on 6.x-1.x branch. Will be in the next release.