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.

CommentFileSizeAuthor
og_event_load_node.patch79 bytes-redShadow-

Comments

pounard’s picture

Status: Active » Needs review

Thanks, I will review as soon as I can.

pounard’s picture

Version: 6.x-1.0-beta1 » 6.x-1.x-dev
Status: Needs review » Needs work

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

pounard’s picture

Status: Needs work » Fixed

Fixed and commited on 6.x-1.x branch. Will be in the next release.

Status: Fixed » Closed (fixed)

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