0

This seems like it should be a simple operation, but I must be completely blind because I can't find anything about it in the API docs at http://www.drupalcontrib.org/api/drupal/contributions!og!og.module/7.

I have a $gid. I need to check if it really is the gid of a valid group, and have access to the group information if it is.

I did find an old post somewhere saying to use og_load(), but that is out of date -- that function does not exist in the current API. Nor can I find a function with similar functionality.

There has to be a simple way to do this; it's hardly an outlier use-case. What am I missing?

2 Answers 2

3

You don't need to use group_load anymore! Use node_load instead. You gid is equivalent to nid.

1
  • With node_load .. It dosn't display if current user (subscribe or not) ..
    – 3zz
    Mar 26, 2017 at 14:21
0

you could use og_get_group() http://api.drupalhelp.net/api/og/og.module/function/og_get_group/7 API to get the og group. It Return a loaded group entity if exists or create a new one.

1
  • Actually, that's the 7.x 1.0 API. That function no longer exists in the 7.x 2.0 API. Mar 18, 2016 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.