Split from #3029908: Add revisions tab on groups
Problem/Motivation
When allowing revisions on Groups in Drupal 10.1, a duplicate Revisions tab appears.
Steps to reproduce
- Install Group module on Drupal 10.1; specific module version doesn't seem to matter (happens on v1/v2/v3).
- Create a new Group Type. Ensure "Create a new revision when a group is modified" is checked (default). No need to update any settings from default options. No need to add fields or set anything else up.
- Create a new Group ("Add Group"). Mindlessly create the group and complete membership.
- You'll land on the page for your own "group membership relationship." Use the breadcrumb links to find your way to the group you just created.
- Group will show two Revisions tabs.

Proposed resolution
Don't show two Revisions tabs, only show one of them (but definitely don't show zero of them, even on Drupal 9 or 10.0).
The patch provided in the first comment resolves the issue in Drupal 10.1 but zaps the revisions tab in Drupal 9 and 10.0. It can be used as a temporary fix for Drupal 10.1 sites but cannot be applied to the project as-is.
However, if this issue does not get addressed by Dec 13th, 2023 when Drupal 10.0 goes End-of-Life, then we may be able to apply this patch and stage new backward-incompatible minor versions of the project, assuming the patch is otherwise sound.
Patch credit @RichardDavies
Remaining tasks
Write a patch (or patches) which apply to Groups versions 1, 2, and 3 and which work on Drupal 9.5 through 10.1.
| Comment | File | Size | Author |
|---|---|---|---|
| #36 | group-3397063-MR145-36.patch | 544 bytes | mably |
| #35 | 2-3-x.png | 104.77 KB | kristiaanvandeneynde |
Issue fork group-3397063
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
caesius commentedComment #3
caesius commentedComment #4
le72Have the same issue. Drupal 10.1.6, Group 3.2.1.
Comment #5
markfien commentedSame issue with Drupal 10.1.6, Group 2.2.1
Comment #6
le72The patch #2 fixed the issue.
Comment #7
idebr commentedComment #8
markfien commentedThe patch is for 3.x -- we are using 2.x -- is there a patch for that version please.
Comment #9
le72Comment #10
caesius commentedPlease read the issue description.
This patch only works on Drupal 10.1.
Drupal 10.0 is not EOL until December 13th and even then it would be up to the project owner to decide whether to apply this patch as-is, making the project incompatible with Drupal <10.1.
If you're able to provide a patch that also works on Drupal 9.5 and Drupal 10.0 then please do so.
Comment #11
caesius commentedComment #12
msnassar commentedHere is a patch that should work for all versions.
Comment #13
somebodysysop commented@msnassar The patch in #12 works for all versions of Drupal (9/10) or all versions of Group? We are running Group 2.x.
Comment #14
msnassar commented@SomebodySysop It should work for all Group (1/2/3) and Drupal (9/10) versions. However, you don't need it for Drupal < 10.1
Note: This is a temporary fix. It can be used until Core and Group completely switch to the generic revision UI.
Comment #15
ulethjay commentedI'm curious now...
Patch #2 removed the group module's link task and patch #12 removed core's link task.
Which, if either is the correct approach?
Comment #16
ulethjay commentedWell... here's my take on a patch. Rather than simply removing one or the other, I went with checking the local menu for duplicate "Revisions" tabs and removing all but the first.
In theory it could be applied to any past or future version of Drupal or Group, and not do anything silly. Though I've only tried it on Drupal 10.1 and Group 3.2.x
Edit:
I acknowledge that this is a dirty hack. But hopefully hack that won't break stuff if accidentally left in place after a more thorough fix is implemented.
Comment #17
kristiaanvandeneyndeThis will be fixed in the next release because that one will bump the minimum supported core version to 10.2 and therefore allow me to remove my copy of the local task.
Comment #19
kristiaanvandeneyndeWill go with the fix from seanB in #3397214: Duplicate revisions tab with Drupal 10.1, so adding credit. We can take that approach now that we've bumped the minimum version to D10.2 In a world where we kept older D10 versions supported, @ulethjay's patch actually makes sense, so I wouldn't consider it a dirty hack per se.
Comment #21
kristiaanvandeneyndeComment #22
kristiaanvandeneyndeRight, this goes green so if anyone can confirm this is working on their end, I've got the +1 I need to commit this.
Comment #23
caesius commentedseanB's patch appears identical to the one I initially attached to this issue; I took it from RichardDavies on the parent ticket: https://www.drupal.org/project/group/issues/3029908#comment-15205403
edit: Well, not exactly identical, the path to the group.links.task.yml file is different. Frankly not sure how the "original" worked then...
Comment #24
kristiaanvandeneyndeYeah, you got credit too for that. Just mentioning why I'm adding seanB to the list.
Comment #25
caesius commentedI didn't write the patch though, so make sure to credit RichardDavies -- he got to this way before anyone else :P
Comment #27
kristiaanvandeneyndeComment #28
caesius commentedAnyway, I've just tested the other patch and it also appears to work. Not sure what's up with the different paths between the two files but as long as they commit to the actual project identically then it's a non-issue.
I have tested this on Drupal 10.1 on Group 2.x with an actual project (and been using the patch on production for months) and it checked out fine there.
However on Drupal 10.2/Group 3.2.2 with a sandbox project I should note that applying the patch on an existing installation results in a WSOD:
I have no idea if it's a "just me" issue or not, but this definitely needs more testing on latest Drupal+Group 3.2.2 to confirm that committing this won't hose existing projects. I've reinstalled several times and I get the error whether I apply or un-apply the patch after installing and setting up Groups.
Comment #29
kristiaanvandeneyndeGiven how all tests go green I'm erring on a "just you" issue :) But thanks for bringing it up, definitely something to keep an eye on.
Comment #31
kristiaanvandeneyndeJust confirmed this was working on on of our installations. Committing
Comment #34
mably commentedBug still present on group 2.2.2...
Comment #35
kristiaanvandeneyndeComment #36
mably commented