Support for Revisions of Group Relationship Entities

Created on 23 July 2020, over 4 years ago
Updated 4 August 2024, 3 months ago

Problem/Motivation

I would like to be able to track revisions of group content entities. Specifically, I want to know the history of when a user became a member of a group, or was removed from a group, or had their role changed. (Note that this is not about tracking the history of the entities that the group content entities refer to, i.e. not about tracking the revisions made to user entities).

I imagine it would also be useful to be able to track revisions of group content entities that refer to nodes (again, that's not about tracking changes to the nodes themselves). This isn't a requirement of my own, however.

I note that #2829966: Support for Revisions on groups explicitly does not include support for group content. I am wondering why that is? Is it because it would be very difficult to implement? Or maybe nobody has yet requested this feature?

I've searched through the list of issues from the group module, and I cannot see any previous mention of this - so I'm raising this in the hope of at least kicking off a discussion.

I am wondering if anyone else has experience (good or bad) of attempting to make group content entities revisionable? Are there particular difficulties to be overcome because different types of group content (users, nodes) require different plugins?

Steps to reproduce

N/A.

Proposed resolution

I have in mind to follow the lead of the user_revision module, so that this functionality can be provided as an optional add-on. The process which user_revision uses to convert existing users to a new storage arrangement, however, now seems to have been superseded by much simpler methods. The pages /node/3034742 and /node/3086279 provide useful guidance on the latest ways to convert existing entities to be revisionable.

Remaining tasks

tbc

User interface changes

tbc

API changes

tbc

Data model changes

tbc

Release notes snippet

tbc

Feature request
Status

Needs review

Version

3.1

Component

Code

Created by

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.

  • 🇺🇸United States brad.bulger

    Is this any more or less feasible now in Group 3 and beyond? I didn't see any reference to group_content or group_relationship in any of the "make group revisionable" issues, but there are many of them, I may have missed it.

  • 🇧🇪Belgium kristiaanvandeneynde Antwerp, Belgium

    Group relationship entities are not revisionable because of the risk involving memberships and more specifically the roles field. Users are also not revisionable (see #540118: Add revision support to users ).

    I can see how people might want to have these relationships support revisions, but it would be a large undertaking to properly analyze the risks involved and how we would support revisions on some bundles (aka plugins) and not others.

  • 🇦🇹Austria jordik

    If the requirement is only to keep track of the relationship and changes of the fields attached to it (such as Roles) and NOT to be able to revert to a previous revision of the group relationship - there is a contrib module, which does the tracking according to your specs - Entity Log .

    I have some custom fields on the group membership, which I wanted to keep a history for and the Entity Log helped me with this. After installing the module you need to select the type of entity - in this case Group relationship / Group Membership. Select the fields you want to track the changes for and check Log in Entity Log entity. This will save every change of the fields you selected into a dedicated table. You can then create views based on Entity Logs and customize them to view the changes.

    When the user is removed from the group the membership relationship gets deleted, but the history of field changes remains. I guess with some additional code the user ID (not the relationship ID) can be added to the entity log to keep the history even if the group relationship is deleted.

    Hope this helps.

  • Status changed to Needs review 3 months ago
Production build 0.71.5 2024