Questions tagged [group]

Use it for questions related to the Group module, not the Organic Groups module.

Filter by
Sorted by
Tagged with
0 votes
0 answers
13 views

Automatically Insert value in field while creating content depending on user

I am stuck on something. I have different users each representing a specific Faculty. Using the groups module I let each one edit and delete its own content but while creating a content of custom type ...
user avatar
0 votes
0 answers
50 views

Upgrading to 8.8.0 Receive PluginNotFoundException: The "group" entity type does not exist

I'm updating from 8.7.4 to 8.8.0. After updating core/modules and running "/update.php", I receive the follow error: Drupal\Component\Plugin\Exception\PluginNotFoundException: The "...
user avatar
0 votes
1 answer
18 views

Disable content creation outside group context

I'm using the group module. I have a content type for which nodes should only ever exist as members of groups. Is there a sensible way to disable creation from /node/add/{content_type} so that nodes ...
user avatar
  • 550
0 votes
0 answers
8 views

Get Group Name (label) of group the currently logged in user is in

We have created several groups using the groups module in Drupal 9. We have assigned some users to these groups. A user can only be in one group. Now when the user is logged in, we have block in the ...
user avatar
  • 345
0 votes
1 answer
31 views

How to pass group context to custom form page using group module

I have a custom block that is displayed within each group on every page. The block visibility is set to /league/* The custom block shows up fine for /league/{gid}, /league/{gid}/members, /league/{gid}/...
user avatar
  • 405
0 votes
1 answer
8 views

Page not found when viewing Group entities

I'm using the Group module and I've defined an "Organization" group type. When I create an entity of that type by going to /group/add and hit save, I get Page Not Found for the url /group/1. ...
user avatar
  • 550
0 votes
0 answers
69 views

How can I remove or rename tabs from the local tasks block?

I'm using Drupal 9.2.6 with Group module and I want to remove some tabs from local tasks block and rename some of them. I've created the module and placed above code with hook_menu_local_actions_alter ...
user avatar
2 votes
1 answer
30 views

$group->addContent() in hook_node_insert() doesn't update the access permissions for the node

I have a content type with a field that lets the users decide which group to add the content to. The content is added to the group via hook_node_insert(). function tm_wiki_node_insert(NodeInterface $...
user avatar
  • 21
0 votes
0 answers
7 views

Using group module, get SUM from the groups content in a view

I am using the group module and each group can create "tournaments" content. Within that content is a multivalue paragraph that contains a user id and a number field. Using views, I would ...
user avatar
  • 405
0 votes
0 answers
132 views

How to display the nodes with the reference entity "Group type" of the same type as the current group?

I have a website built with Drupal 9 and I installed the Group module. I created a "Help" content type with an "Entity reference" field that refers to the group type. I have ...
user avatar
0 votes
0 answers
10 views

How to display group operations block not in a dropbottom menu either "normal" links list/HOOK_block_build_group_operations_alter does not fire

currently the links of the "group operations block" of group module are displayed in a dropbutton menu. I want them to get displayed in a "normal" link list. I found an issue (...
user avatar
  • 129
0 votes
0 answers
38 views

Entity reference field dependant on other entity reference field

Drupal 9. I have a content type with two entity reference fields. The first entity reference field references group entities provided by the group module. The second entity reference field references ...
user avatar
  • 550
0 votes
0 answers
36 views

How to limit the addition of a single node in a Group?

On my Drupal 9 site and Group module. I created a type of group "Blog". I want that in a group, only one node of type "Article" can be added. How to limit the addition of a single ...
user avatar
  • 33
1 vote
1 answer
53 views

Is it possible to add an entity to the current route parameters?

Using \Drupal::routeMatch()->getParameter(), it's possible to fetch objects that come from the parameters of the URL. I'm wondering if it is possible to add values to the routeMatch. For example, ...
user avatar
  • 14.5k
0 votes
0 answers
23 views

Custom entity access control based on group membership

I am using the group module in Drupal 9 to control access to content by user groups. I have a custom entity defined as a single table unfieldable entity. The entity has a "group ID" base ...
user avatar
  • 550
-2 votes
1 answer
28 views

Views Reference Field shows nodes of all groups

On my website users can create groups. All groups have two content types: Book Chapter (is always a child of content type Book) Only administrators are allowed to create new nodes. An administrator ...
user avatar
-1 votes
1 answer
74 views

Is it possible to check with Twig the role the current user has?

Is it possible to check with Twig the Group role the current user has, to use it as in the following code? {% if is_member == true %} {# … #} {% endif %} I tried with $group_memberships = \Drupal::...
user avatar
0 votes
1 answer
88 views

Cannot update Group module with composer

We are using the Group module on our D8 site. We use composer to manage our modules and dependencies. I am somewhat of a composer novice, so it's possible that the solution is right in front of me, ...
user avatar
  • 435
0 votes
1 answer
72 views

Show latest content date from group content type

I've a group type vendor with following groups: V1 V2 V3 Each group is associated with content type notes as shown below: Notes (Content Type) with nodes associated with groups: N1 (Group: V1) N2 (...
user avatar
  • 121
2 votes
2 answers
466 views

How do I get group to which the node belongs and redirect anonymous users to the login page if they land on it?

I'm using the Drupal Group module and I've added content to a Drupal group I've created. I've also added users to this Group. Works well: Drupal users have to login to see this content in that group. ...
user avatar
0 votes
0 answers
86 views

Prevent access from files with direct url

In the Group module people can upload files if they're group manager. But the thing is, these files should be restricted to the group and everyone who isn't a member may not see this files. The ...
user avatar
1 vote
1 answer
66 views

How do I set a condition to only show a block to a group members?

Is there a way to check whether a user is a group member when the user visits the group page? I have some blocks that should be hidden if an user is not a member.
user avatar
-1 votes
1 answer
33 views

How do I list all names of the same group type?

For a Group type (Birds), I tried to create a View in Drupal 9 to list all groups of that type, but I end up getting a group title entry for every node, for example this list. Birds groups Hawks ...
user avatar
  • 101
0 votes
2 answers
55 views

How to filter my view of Groups to show results matching Term A or Term B

I am adding taxonomy terms to groups (using the group module) and want to use the terms to filter groups within a view. However, my exposed filters don't seem to work. There is no error, but the ...
user avatar
1 vote
0 answers
72 views

How to ensure that node access check results are enforced everywhere? [closed]

I am trying to do this without hook_node_grants because, for some reason, it messes with the nodes that are being controlled by the 'Group' module. The Group module itself used to use Node grants, but ...
user avatar
  • 411
1 vote
1 answer
75 views

How to create a message with message stack when user becomes a member of a group module group?

Hi currently I try to code a custom module for notification based on message stack module. Now I'm searching for the event or hook to perform some custom code when the user becomes a member of a group....
user avatar
  • 129
0 votes
1 answer
138 views

Which hook to use to detect new members added to group?

What is the best way to make a hook that only fires when new members are added to a group? I have a function that exports group memberships to moodle course enrolments. Right now I have it bound to ...
user avatar
  • 71
2 votes
1 answer
199 views

Get user ids of group members

I want to get a list of all users that are members of a group. I can get the members using getMembers(): $members = $group->getMembers(); foreach ($members as $member) { var_dump($member);...
user avatar
  • 71
2 votes
0 answers
336 views

Get the ID of the group to which the node is added

Using Drupal 8 with the Group module, I have an action that is run via hook_node_insert that needs to know the group id of the group that the node is added to. Im using this code to get the group id ...
user avatar
  • 71
0 votes
0 answers
27 views

Entity Query returns incorrect results while running functional javascript test

Im writing a functional javascript test for my project where im facing a problem with my feature. I have created a group entity just above it and referencing a parent group. This doesn't work: $...
user avatar
  • 1
0 votes
0 answers
36 views

How to add the Group Role as body class in the page template

I like to add the Group Role of the currently logged in user to the body class of the page twig template. So this is not the same as the user roles the user account has. Currently using Drupal 9.0.3. ...
user avatar
  • 586
0 votes
1 answer
48 views

How do I trigger group membership was granted for a user - Group module

I try to use group module in d8. 1. I created a new group type named test 2. I added 2 group as demo with admin is default group_membership. 3. in group 1 (name okok) I edited and added new user to ...
user avatar
  • 101
0 votes
1 answer
43 views

Get enabled content types machine name

I'm trying to get the enabled content type machine names for a given group. I wrote the following code, but to get the machine name I should cut the strings to group_node:. /** @var \Drupal\...
user avatar
0 votes
2 answers
28 views

How to return a user's group access permissions?

I am trying to block a user from accessing certain content/blocks if they do not have permission to view content of a certain type within a group. I have the user ID and the group ID, but how do I ...
user avatar
0 votes
2 answers
135 views

How to check if current page is a group entity?

Im using drupal 7 and group module I am trying to run some code only if the current page is a group. here is my code <?php $arg = arg(0); $arg1 = arg(1); global $user; if($arg ='group' &&...
user avatar
0 votes
1 answer
47 views

Create Group permission to grant view of all group content

I'm running Drupal 8.7.11 and Group 8.x-1.0-rc5. I have a situation whereby I have > 5,000 groups. The majority of the users are members of 10 groups. However I have a small set of users who need ...
user avatar
  • 159
1 vote
1 answer
255 views

How do I add a user to a group?

I am using the Drupal 7 version of the Group module. I found this Drupal 8 code which adds a user to a group, and I can't find anything similar for Drupal 7. use Drupal\Core\Entity\ContentEntityBase; ...
user avatar
0 votes
1 answer
18 views

How do I get the list of permissions?

I am trying to use the group method hasPermission(permission_label, user). I found an example that is the following: $group->hasPersmission('administer members', $user) I would like to know ...
user avatar
0 votes
1 answer
189 views

How can you get the route name/path of groups?

I am new to Drupal 8. I am working on groups module and want to assign different themes to different groups.So i need route name of groups. how to find route name of groups. Thanks in advance. /** ...
user avatar
0 votes
0 answers
88 views

Group id not shown when view is empty in Drupal 8?

I am new to Drupal 8. I make custom view field (programmatically) and pass session variable to it.Session variable contain group id. The problem is that when the view is empty i mean no content in ...
user avatar
0 votes
1 answer
123 views

Getting session variable in view contextual filter drupal 8

I am new to Drupal 8. I get group_id in session variable just like that $_SESSION['groupbysession']['group_id'] = $path[2];. now i want to get that session variable in view Contextual filters.I have ...
user avatar
0 votes
0 answers
14 views

A different set of terms for each group?

I am considering to use de group-module to organize nodes by department. Each department has different taxonomy terms to classify their nodes. The goal is to have them describe their howto's and ...
user avatar
  • 49
0 votes
1 answer
33 views

drupal 8 modifying the menu items path

I work on an drupal 8 application that use the group module with the restriction of only one group per user. i want to be able to modify the menu items so that the id of the user's group is always in ...
user avatar
0 votes
1 answer
194 views

Explicitly passing argument to local action for access check

I'm using the group module, and in a custom module I'm trying to create a local task that will bring you directly to the create page for a particular group content type. My goal is to skip the create ...
user avatar
1 vote
0 answers
39 views

Sub groups under groups

Anybody has idea about how we can have Sub Groups under Drupal Group? This module; https://www.drupal.org/project/group, will manage grouping of content, users.... perfectly. But we are looking to ...
user avatar
1 vote
1 answer
70 views

Using group and rules modules to automatically create group for new user

I am using the Group (not OG ...) and rules modules for this task. I created group type, Applications Support. Then I created a rule, After saving a new user. Under the rule, I used the following ...
user avatar
  • 53
0 votes
1 answer
51 views

How to normalize / resolve membership ID to all account UID per group_content

I'm trying to add the owner's membership to every GroupContent. By default ownership is only identified by the Account ID. It seems a Normalizer and/or custom resolver is necessary. Beyond my ...
user avatar
  • 374
-1 votes
1 answer
260 views

Webform Group Member Composite

I need to create a Webform element that has a list of group members, each with their own checkboxes and text fields ('job description'). I figured out how to display checkable group members through a ...
user avatar
  • 21
2 votes
2 answers
592 views

Programmatically remove content from a group

In order to add a node to any group in Drupal 8, I use the following code. $group->addContent($node, 'group_node:article'); Now, for removing content from a group, I have tried $group->...
user avatar
1 vote
1 answer
534 views

Where in the MySQL database schema is the URL alias for a group relation?

I am building a report outside of Drupal that pulls data from a Drupal 8 database. The report shows titles of different nodes and I want to link those titles to the web page for that content. This ...
user avatar
  • 111