Group nodes and admin are displayed twice

Created on 8 October 2022, about 2 years ago
Updated 11 September 2023, over 1 year ago

Problem/Motivation

When I add an existing node to a group, it appears as a twice on all views of the website.

This appears to affect any View of content belonging to mulitple groups. Even the Path Alias list shows duplicate items now.

There is also a problem with the group admin which is also duplicated.

Steps to reproduce

  1. Set up a new sandbox with Drupal ^9.5.0 (Creating a "drupal/recommended-project:9.5.10")
  2. PHP version 8.1.16
  3. drush si standard
  4. composer require 'drupal/group:^2.2'
  5. drush en group
  6. drush en gnode
  7. /user/login (uid1)
  8. /admin/group/types/add (Name: Business unit, Access settings: Automatically configure useful default roles and Automatically allow accounts with this role to manage all groups of this type they are a member of are selected ONLY)
  9. /admin/group/types/manage/business_unit/roles/add (Name: Group creator, Scope: Individual, Admin role NOT selected)
  10. /admin/group/types/manage/business_unit (Access settings: Group creator roles: Group creator selected)
  11. /admin/group/types/manage/business_unit/content
  12. /admin/group/content/install/business_unit/group_node%3Apage (Adds Basic page content to groups both publicly and privately.)
  13. /group/add/business_unit (Title: Test business unit)
  14. New group (business_unit type) generated with group id: 1
  15. /group/1/members (admin user appears four times, twice with Group creator role and twice without role)
  16. /group/1/content/create/group_node%3Apage (Title: Basic page 1, Published: Yes)
  17. /group/1/nodes (Basic page 1 node appears twice)
  18. /admin/content (Basic page 1 node appears twice)

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Original report by [username]

πŸ› Bug report
Status

Closed: duplicate

Version

3.0

Component

Code

Created by

πŸ‡«πŸ‡·France zenimagine

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¨πŸ‡¦Canada minoroffense Ottawa, Canada
  • πŸ‡¨πŸ‡¦Canada minoroffense Ottawa, Canada

    This appears to affect any View of content belonging to mulitple groups. Even the Path Alias list shows duplicate items now.

  • πŸ‡¨πŸ‡¦Canada minoroffense Ottawa, Canada

    This is a pretty problematic issue so I'm marking it as major.

  • πŸ‡ΊπŸ‡ΈUnited States pcate

    This appears to affect any View of content belonging to mulitple groups. Even the Path Alias list shows duplicate items now.

    I can confirm I'm see this as well with Group 2.x when a content node is added to multiple groups. I'm seeing the duplicates on both the group node list and the regular /admin/content view.

  • πŸ‡ΉπŸ‡­Thailand AlfTheCat

    In my case this happens even when a node is just part of a single group.

    Every single contextual view also repeats. Using 3.x

  • πŸ‡ΉπŸ‡­Thailand AlfTheCat

    In my case the aggregation workaround didn't work for views using contextual filters (displays with fields of the node being viewed). Enabling aggregation or limiting the results to 1 item resulted in a fatal error.

    The dirty work-around solution there is to instead set the number of items to display to 1 but skip the first result (offset 1).

  • i have the issue also, Drupal 9.5.9, Groups 3.1.0. Setting the view to use distinct is a workaround...

  • πŸ‡ΉπŸ‡­Thailand AlfTheCat

    I'm also suspecting that a duplicate relationship is being created.

    I feel like there might be some crucial information missing from the documentation. I was looking for the same thing that groups did in Drupal 7, to have a group reference field on a node and allow content to be added to a group that way, instead of only from the group page which is how it seems to be in 3.x.

    I eventually replicated it by using entity reference for group selection and creation, and then use an ECA model to add the node to the group. I have a nagging intuition that however it is that the group module manages relationships between groups and users and nodes, that processes is firing multiple twice.

  • πŸ‡­πŸ‡ΊHungary mxr576 Hungary

    Applied the issue template so steps to reproduce can be added easily.

  • πŸ‡·πŸ‡ΈSerbia korinna

    Turning the creator wizard off (as suggested by Kristiaan Van den Eynde in the Drupal slack channel) seems to be a workaround for the newly created groups. A new node added to the new group shows up only once on the /group/3/nodes view (and on the /admin/nodes view as well) and there is only one admin member on the /group/3/members view with Group creator role.

    The existing ones still have the admin account displayed four times on the members view (twice without role and twice with Group creator role). The root cause of this is the same - the groups were previously created with the Group creator must complete their membership option selected.

    By deleting one of the admin users (e.g. the one added with id: 2 to the group during its creation), there remains only one admin user in the group with Group creator role. It seems that this might still need a fix considering the existing data.

  • Status changed to Closed: duplicate over 1 year ago
  • πŸ‡§πŸ‡ͺBelgium kristiaanvandeneynde Antwerp, Belgium
Production build 0.71.5 2024