Incompatibility with the Group module

Created on 21 March 2023, over 1 year ago

Problem/Motivation

Unfortunately, I have discovered an error that is a bit unattractive. I use this module to convert nodes into groups. Each group has three different content types, from time to time it is necessary to convert the content type.

The conversion can only be done by the administrator, group users cannot perform this task. The conversion also works wonderfully, the existing fields are taken over and the new node type is displayed in the group, can be called up, BUT can no longer be edited by the creator of the node.

At first I thought it might be because this module changes the UID of the node, which fortunately is not the case. However, by chance I found out that the node type is not updated after the conversion in the group_content_field_data table in the type field.

There is an access check for groups, both must be TRUE, content type + UID. Now if another node type is called, but the group still has another node type, group returns a FALSE (unknown content not allowed to be accessed).

This can be easily reproduced by changing a node back to its original type. Afterwards, the user of the group can edit the node again without any problems.

For this, only the type would have to be taken into account during the conversion.

Steps to reproduce

  • install Drupal 9.5.x
  • install Group module, version 1.x
  • configurate Group, connect two node types to group
  • install convert bundles module
  • create a node with type 1, as group user
  • convert existing node to type 2 as administrator
  • try to edit the node as group user -> access denied
  • convert the node back to type 1 as administrator
  • try to edit the node as group user -> access allowed

Proposed resolution

If so, the node type must be updated in the group_content_field_data table in the type field. The machine name of the node must match that of the group.

Ideally, this would be a patch.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇩🇪Germany zcht

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

Comments & Activities

Production build 0.71.5 2024