Problem/Motivation
Currently when using Content and moderation
- create bundle that allows layout overrides and is moderated
- create a moderated node of bundle
- publish it
- Create a forward revision.
- Login as user *only* has default permissions plus "configure any layout"
- Save the layout override
- Log back in as admin.
- The node no longer has revision that is considered a forward revision
I have tried to create a failing test but i have never made a content moderation test and it wasn't working
For now I have recorded this screencast which shows the problem: https://youtu.be/uxuNuaI2xoo
I tried the patch #2937199-9: Track Layout override revisions on entities which support revisioning but it didn't fix it.
Proposed resolution
Saving an override is weird because it is saving the entity you update a field but you don't have to have edit permission.
If this wasn't the case the user would not be able to edit the entity.
Maybe if the entity is moderated and the user doesn't have edit access we should allow them save an override. Or maybe just if there is forward revision.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | 2973860-revision-11-combined-2942675-43.patch | 23.96 KB | tim.plunkett |
| #10 | interdiff-2973860-9-10.txt | 1.08 KB | bendeguz.csirmaz |
| #10 | 2973860-10.patch | 2.32 KB | bendeguz.csirmaz |
| #9 | 2973860-9.patch | 2.23 KB | bendeguz.csirmaz |
| #9 | interdiff-2973860-8-9.txt | 1.18 KB | bendeguz.csirmaz |
Comments
Comment #2
plach@timmilwood asked me to have a look at this. IMO we have two problems here:
Comment #3
timmillwoodThanks for looking into this @plach. I thought it might be the case where we'll need to wait for #2942907: Entity system does not provide an API for retrieving an entity variant that is safe for editing.
Comment #5
tim.plunkettPostponing this on #2942907: Entity system does not provide an API for retrieving an entity variant that is safe for editing.
Comment #6
xjmIs this a duplicate of #2942675: Layout builder should use the active variant of an entity to avoid orphaned revisions? If so, we can close it as such; if not, it's also critical.
Comment #7
tim.plunkettI believe this is still relevant on its own.
Comment #8
bendeguz.csirmaz commentedHere's a rudimentary test for this.
Comment #9
bendeguz.csirmaz commentedUploading the fix by @tim.plunkett
Comment #10
bendeguz.csirmaz commentedFixed the test assertion - it loads the latest revision now.
Comment #11
tim.plunkettCombined #10 with #2942675-43: Layout builder should use the active variant of an entity to avoid orphaned revisions to see if it passes.
Comment #12
tim.plunkettComment #13
johnwebdev commentedBlocker is in
Comment #14
plachWith #2942675: Layout builder should use the active variant of an entity to avoid orphaned revisions committed, is this still relevant? I think at very least we need an IS update.
Comment #15
tim.plunkettTentatively closing this in favor of #3032287: Add the content moderation state widget to the layout builder entity form..