Closed (fixed)
Project:
Group
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
1 Feb 2019 at 01:55 UTC
Updated:
27 Oct 2023 at 19:59 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jidrone commentedHere is the patch.
Comment #3
jidrone commentedAdded a fix to make content moderation optional when reverting revisions.
Comment #4
jidrone commentedAdded view link on revision tab list, for better UX.
Comment #5
jwilson3Patch no longer applies to 8.x-1.x
Comment #6
jwilson3Comment #7
jwilson3The patch in #4 applied to 8.x-1.0-rc4 but not 8.x-1.0-rc5 nor 8.x-1.x branch so I've uploaded two re-rolls, one for each in case someone needs.
These are automated re-rolls based on git rebase, so an interdiff is not really possible. There were a few very minor merge conflicts between rc4 and rc5 and 8.x-1.x.
Comment #8
jwilson3This patch brings down a few additions from the parent ticket's latest patch #2829966-47: Support for Revisions on groups.
See interdiff to identify the changes. A few alphabetical order of use statements, yaml file formatting consistency with other entries in the same file, and added the "Revisions" group operation (similar to View, Edit, Members operations) w/ tests.
Comment #10
jwilson3Whoops ignore these patches. wrong issue.
Comment #11
jwilson3I guess the reason for these fails is that the tests require code from #3029907 to execute successfully, which explains why they were removed in previous patches :(
Note that the test that fails here runs successfully once merged with the sibling issues in the parent issue (see test on comment #53 #2829966-53: Support for Revisions on groups).
Comment #12
sadysierralta commentedMade some small changes to allow the patch work in D9.
Comment #14
kristiaanvandeneyndeReroll
Comment #16
kristiaanvandeneyndeSmall update while I'm working on this: There's a lot of code copy-pasted from node in this patch that core is trying to get rid of. So I'm completely revising this patch to use more from Entity API (the module we depend on) and core itself.
Comment #17
kristiaanvandeneyndeComment #18
kristiaanvandeneyndeThis is fully reviewed code-wise but still needs tests. The only thing that still needs work is GroupRevisionDeleteForm (and its route declaration) as we are using the RevisionRevertForm and its route declaration form Entity API, but said module does not have a delete form for us to use and I'm asking around about why that is.
Furthermore, the mini-form for content moderation will check for global "use foo transition" permissions, but that's out of scope for this patch. Ideally, that one also gets a group permission based alternative by decorating StateTransitionValidation and looping over the workflows to declare group permissions where applicable (i.e. the enabled group types).
Comment #20
kristiaanvandeneyndeWhoops, misplaced a file.
Also the delete form seems to be missing due to it never being finished in #2625122: [Meta] Implement a generic revision UI.
Relevant core issue here: #2350939: Implement a generic revision UI
I'll review both issues next week.
Comment #22
kristiaanvandeneyndeOkay so reviewing the other issues, it seems clear that the code we're borrowing from Entity API isn't going to get updated soon because more effort is going into the core issue.
This means we should add our own delete form and route for the time being until we can safely rely on Drupal 9.3.0 (or later if commit is delayed) and up. The approach taken still borrows most code from Entity API so we should be safe with regard to copying stale core code like the original patch did.
Attached patch should also fix the test fails.
Comment #24
kristiaanvandeneyndeExpecting this to go green now, so I'll work on the delete form and finish up by writing tests.
Comment #25
kristiaanvandeneyndeStill needs tests but has the right delete form now.
Comment #26
kristiaanvandeneyndeHere's some tests already for the overview access checks. Now that I got that working, the other routes should hopefully be easy to pull off.
Comment #27
kristiaanvandeneyndeThis adds all the UI access check tests. I'd like to harden the view case a bit more regarding unpublished groups, but the route access tests are pretty much finished now.
Comment #28
kristiaanvandeneyndeThis severely expands view access tests. I'm checking the patch one last time to see if it needs more tests and will then probably commit it.
Comment #29
kristiaanvandeneyndeWow, this was a nightmare to fix. Turns out some pages were broken because of missing revision users or timestamps. After a long hard search, I found that the mechanisms in core to convert an entity type to be revisionable just doesn't care at all about these fields. So I ended up having to write an update test after all to confirm that this bug is fixed by adding a custom storage.
Comment #31
kristiaanvandeneyndeOkay, fixed. Waiting for reviews to come in and then cutting a new release.
Comment #33
richarddavies commentedAfter upgrading to Drupal 10, all of my groups now have two "Revisions" tabs:
Both tabs link to
/[group_alias]/revisions. I'm using Groups 1.5 and Drupal 10.1.2.Comment #34
richarddavies commentedIn case anyone else runs into this issue, here's a patch to remove the redundant Revisions tab that's now being added by Groups. (The other tab is coming from Drupal 10's system.links.task.yml.)
Comment #35
kristiaanvandeneyndePlease file a new issue for this (or search if one exists)
Comment #36
kristiaanvandeneyndeComment #37
caesius commentedSplit off a new ticket to address the issue with duplicate Revisions tabs. #3397063: Drupal 10.1: Revisions tab appears twice on Groups