Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Also here: ...default_user_groups (not S in user).
+++ b/og.moduleundefined
@@ -2958,3 +2958,55 @@ function og_needs_migrate($migrate = NULL) {
+ * Gets the GIDs of all the groups a user belongs to, for use by Views.
Maybe better: Get all the group ID a user is an active member in.
+++ b/og.moduleundefined
@@ -2958,3 +2958,55 @@ function og_needs_migrate($migrate = NULL) {
+ * This function is primarily used to load arguments (contextual value filters)
That's not right. You need to og_memebrship_load_multiple() those og_memberships and extract the group Id from them (the key you get is the og-membership ID).
1) I changed the og_get_user_groups() to return an array, which I felt made sense.
2) I spent some time looking for a way to get EntityFieldQuery to return more properties than the standard entity stubs, but I couldn't find it. I think I read in Drupal 7 module development that it can be done, but the book is not nearby. (That would save a few extra loads, which would be nice.)
This is a great improvement.
Does it let you sort the group content nodes by their posted date without regard to which group they are in?
We want to show all a user group posts without grouping by group.
heh. these terms are confusing, eh.
I tried to remove the 'grouping' from the view format settings and it removed the group name.
that answers my question #9.
sweet.
again, nice improvements, eh.
Any way we can get a 1.3.1 version of OG with this in it? This seems to be a more requested feature and a lot of us would rather not move to a dev version if we can avoid it. Thanks!
Comments
Comment #1
Itangalo CreditAttribution: Itangalo commentedI don't get how/why og_get_users() should be used – that function returns the users of a group, not the groups of a user.
But I'm gonna try writing a Views plugin that does what this issue title says. Back soon (I hope).
Comment #2
Itangalo CreditAttribution: Itangalo commentedTadaa!
Comment #3
Itangalo CreditAttribution: Itangalo commented…and here's another patch where the missing EOF blank line is added.
Comment #4
amitaibuOh, nice! :)
Should be: og_user_groups
Also here: ...default_user_groups (not S in user).
Maybe better: Get all the group ID a user is an active member in.
We can remove this part.
We don't need the glue here. Let Views deal with it, as this is a general API function can be consumed by non-Views as-well.
No need for babysitting, let's remove this part.
Lets also check for state == OG_STATE_ACTIVE
That's not right. You need to og_memebrship_load_multiple() those og_memberships and extract the group Id from them (the key you get is the og-membership ID).
Since it's an API function, let's return NULL. The views handler should deal with empty string, if indeed needed.
Comment #5
Itangalo CreditAttribution: Itangalo commentedCool! I'm on it.
Comment #6
Itangalo CreditAttribution: Itangalo commentedThere!
1) I changed the og_get_user_groups() to return an array, which I felt made sense.
2) I spent some time looking for a way to get EntityFieldQuery to return more properties than the standard entity stubs, but I couldn't find it. I think I read in Drupal 7 module development that it can be done, but the book is not nearby. (That would save a few extra loads, which would be nice.)
Comment #7
amitaibuThanks!
I've cleaned up a bit, and committed. I've also added a new default View called "OG all user group content"
Last follow up we need to do, is show a select list from the entity-type in the filter, rather than a textbox, but that's minor.
Comment #8
Itangalo CreditAttribution: Itangalo commentedHooray! That means I can screencast!
Comment #9
pelicani CreditAttribution: pelicani commentedThis is a great improvement.
Does it let you sort the group content nodes by their posted date without regard to which group they are in?
We want to show all a user group posts without grouping by group.
heh. these terms are confusing, eh.
Comment #10
pelicani CreditAttribution: pelicani commentedI tried to remove the 'grouping' from the view format settings and it removed the group name.
that answers my question #9.
sweet.
again, nice improvements, eh.
Comment #12
MD3 CreditAttribution: MD3 commentedAny way we can get a 1.3.1 version of OG with this in it? This seems to be a more requested feature and a lot of us would rather not move to a dev version if we can avoid it. Thanks!