It seems like a lot of things are changing in Organic groups 7.x-2. I'm trying to add Statuses to a group with a context where the Statuses view shows on group node types. But I get this error:

Fatal error: Call to undefined function og_get_group_ids() in /home/scbp/public_html/drupaldev/sites/all/modules/statuses/includes/utility/statuses.contexts.inc on line 233

Any ideas what could be causing this?

Thanks so much!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

IceCreamYou’s picture

Title: Statuses not compatible with Organic Groups 7.x-2 » Statuses not compatible with Organic Groups 7.x-2.x
Category: bug » feature
Status: Active » Postponed

We will support OG 7.x-2.x but it will not be a priority until after Statuses has a release candidate or OG 7.x-2.x becomes the recommended branch (or someone else writes a patch for it).

Renee S’s picture

Status: Postponed » Needs work
FileSize
5.33 KB

Rough work attached. Still testing use-cases. Needs a bit more work still, but here sos people can test. The problem right now is that it doesn't seem to respect og_is_member (and for that, $group_type is actually expected to be given as the content type numeric ID, which is strange and not like how the rest of the OG functions work). The user has to have full permissions to view all statuses, not just be a member of the group.

IceCreamYou’s picture

Thanks for the patch; it helps to have a start. Please note that any fix needs to preserve support for both branches. The easiest way to do that is to check for the existence of a function that is only in one of the branches and use that to determine the appropriate behavior.

Also, there are some formatting things... the Coder module can help catch these. Spaces instead of tabs, spaces after control statements, etc.

Renee S’s picture

FileSize
6.77 KB

Ahh, thanks for the tips. Better patch attached, coder-reviewed and both OG 1 and 2 compatible. There's still a bit of logic weirdness, but it's much closer...

Renee S’s picture

[argh]

mathankumarc’s picture

+++ /statuses/includes/utility/statuses.contexts.incundefined
@@ -230,36 +230,61 @@ class statuses_og_context extends statuses_node_context {
+    else {
+      $node = node_load($status->recipient);
+      $group_access = isset($node->{OG_CONTENT_ACCESS_FIELD}[LANGUAGE_NONE][0]['value']) ? $node->{OG_CONTENT_ACCESS_FIELD}[LANGUAGE_NONE][0]['value'] : $node->{OG_GROUP_FIELD}[LANGUAGE_NONE][0]['value'];    ¶
+      return parent::access_delete($status, $account) && (og_is_member('node', $status->recipient, 'user', $account->uid) || $group_access == 1);
+    }    ¶

Trailing whitespaces

+++ /statuses/submodules/fbss_comments/fbss_comments.moduleundefined
@@ -583,12 +583,18 @@ function _fbss_comments_can_view($comment, $account) {
+      return user_access('post status comment', $account) && $group_access && og_is_member('node', $status->recipient, 'user', $account->uid) ;
     }
-  }
+  } ¶
   return user_access('post status comment', $account);
 }

Trailing whitespace

I didn't looked into the logic.

Renee S’s picture

FileSize
6.76 KB

Test away, folks. Making sure the logic works would be helpful.

Renee S’s picture

Status: Needs work » Needs review
IceCreamYou’s picture

I will try to get some time to look at this on Saturday. If I don't get to it I will do it next week.

SocialNicheGuru’s picture

I have a content type, article.
the article belongs to a group
I created an article and assigned it to a group
I used panels to change layout. panel has content as a mandatory context
I added statuses block

expected result is statuses block shows up
actual result; WSOD without anything in error logs

with the patch WSOD goes away.
But I still don't see the statuses block

barry6575’s picture

Any updates or feedback on this patch? I wish I could help but I'm unfamiliar with coding.

IceCreamYou’s picture

Thank you for your patience. Here is a revised patch. There is also OG integration in the Services submodule which I have not looked at.

I have tested the attached patch and it is working for me. If someone else can confirm it is working it can be committed. Please note that this patch cannot be applied at the same time as #1721452: Statuses not picking nid from a page with custom path (so whichever one we commit second we will need to re-roll).

IceCreamYou’s picture

I committed #1721452: Statuses not picking nid from a page with custom path and it turns out the patch in #12 still applies -- just wouldn't have worked in reverse order.

barry6575’s picture

I tested the new patch and it's working for me.Thanks!

IceCreamYou’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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