Skip to content
This repository has been archived by the owner on Aug 18, 2024. It is now read-only.

Default argument for current user memberships #565

Closed
wants to merge 39 commits into from

Conversation

MPParsley
Copy link
Collaborator

This is a new PR based on #253.

CathLind referenced this pull request in CathLind/drupal_og May 7, 2021
@cofihouse
Copy link

Please help me understand how to create a view which shows all the groups (nodes) to which a user is a member. The view should be visible to anyone who views that user's profile.

I have applied this patch and created a view of group nodes. I can show the Group nodes created by a user by adding user id contextual filter. But beyond that, I cannot figure out how to filter it to show the group nodes that user has authored and those that they are members of (but didn't author).

I have played around with the functionality of this patch, but I am stuck. I see other questions asking for the same thing and none have been answered clearly.

Comment on lines +184 to +188
if (!empty($contexts['og']) && $group = $contexts['og']->getContextValue()) {
if ($group instanceof ContentEntityInterface) {
return $group;
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's return early, instead of indenting the IFs

Comment on lines +137 to +139
// the roles held in the corresponding groups, and while it
// is one level too granular, i.e. the context will be more
// fragmented than strictly needed, it works.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the "is one level too granular" part. What do you mean here?

@amitaibu amitaibu changed the title 254 Default argument for current user memberships Default argument for current user memberships Sep 27, 2023
@claudiu-cristea
Copy link
Collaborator

Since https://www.drupal.org/project/og/issues/3467694 was merged into the 8.x-1.x branch, the development has been moved to https://www.drupal.org/project/og. If this change is still actual, please open an issue at https://www.drupal.org/project/issues/og and provide there a merge request similar with this pull request.

Thank you for contributing to Organic groups module.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants