Postponed
Project:
Drupal core
Version:
main
Component:
content_moderation.module
Priority:
Major
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
29 May 2019 at 16:29 UTC
Updated:
6 Feb 2026 at 09:54 UTC
Jump to comment: Most recent
Comments
Comment #2
alexpottComment #3
sam152 commentedHey @alexpott, thanks for filing this issue. The discussions around this are spread out all over the place, so it'll be good to get a single reference of it.
Here is a bit of a brain-dump of discussion points or issues which have been discussed over the years which I can recall:
Right now, since the entity-attached-field is computed, it's pretty easy to just ignore values that are assigned to it if the entity itself is not being moderated, but that might be tricker with a field with table storage. Either way, it's a better DX when it comes to the field actually surfacing in places where a list of entity fields are present (the api, entity displays, REST etc). I think it would actually improve the current implementation a lot as well, hint hint ;)
For better or worse, the entity exposes a lot of API (from hooks to the views relationship). @xjm had an idea that you could continue to write to the entity while shifting the field over to having table storage, then deprecating all of the touch points, but I think there are quite a few places where deprecating one of the touch points is really tricky, see: #2894479: Deprecate the Views relationship from moderated content to the "content_moderation_state" entity .
I'd fear that we'd be running both side-by-side, a lot of complexity would be introduced and then the efforts to actually remove the entity type would stall or fall flat. Since the deprecation issue exists, it sort of prevents this from happening in one "big bang". Also: #2917276: Allow entity types to be @internal in such a way that removing them doesn't violate any BC.
These are just some initial thoughts, I think there are probably more considerations that would go into this. Overall, I think tackling this would be by far the most complex and disruptive change to CM since the stable release. I do honestly wonder if it needs more motivation than creating additional entities. One of the biggest driving factors in my eyes would be: the code to keep CM entities composite to moderated entities is complex, but again with the deprecation problem I think running it as BC would also be quite complex. Other than that, I think the architecture has served the use-case okay, but I may be bias.
I mentioned this somewhere else, but right now the queue is a bit slow even for fairly small well defined bug fixes or incremental improvements. For something of this scale to work, it would need significant commitment of resources, otherwise my fear would be the work would go to waste. I realise that's a bit meta, but it's been a barrier that has prevented me from looking at any of the above issues more deeply.
Comment #4
sam152 commentedComment #5
amateescu commentedThe reason is that base field purging was not yet implemented in core when the initial workspaces-in-core patch was being written, see #2784921-73: Add Workspaces experimental module (from 27 Sep 2017), and #2282119-91: Make the Entity Field API handle field purging was committed a few weeks later. The only reason why workspaces still went with the "workspace_association" entity type in the final patch is.. lack of time I guess :)
Comment #6
sam152 commentedAh, thanks for clarifying. I seem to remember that there were technical discussions that still favoured the association entity, but without actually tracking them down, I could be mistaken.
Comment #7
sam152 commentedOne other nuance that came to me was: when disabling moderation, the history of the moderation states is retained via the CMS entity. If fields were uninstalled and purged, that would change. I can't think of too many scenarios that would depend on that behaviour, but it's worth being aware of.
Comment #8
sam152 commentedThis issue for me is more validation that managing schema attached to entity types a module doesn't "own" is complex: #3054765: Need to add an entity update event listener to add moderation state for newly revisionable fields.
Comment #18
amateescu commentedPostponing on #2835545: Provide a Workflow FieldType that references a workflow entity and tracks the current state of an entity. The detailed analysis from #3 is super helpful, and we'll need to carefully evaluate each point when the time comes.