Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Buttons disappear on entity forms when entities that are moderated are embedded in that form using inline_entity_form. I'm not sure if the fix should be in content_moderation or inline entity form at this stage.
Proposed resolution
TBD.
Remaining tasks
TBD.
User interface changes
TBD.
API changes
TBD.
Data model changes
TBD.
Comments
Comment #2
Sam152 CreditAttribution: Sam152 at PreviousNext commentedThe offending function is \Drupal\content_moderation\Plugin\Field\FieldWidget\ModerationStateWidget::processActions. Not sure what the fix looks like at this stage.
Comment #3
Sam152 CreditAttribution: Sam152 at PreviousNext commentedI don't expect this patch to make it in, it obviously has IEF specific fixes in it. Possibly IEF could override the widget class an make it work with it's own submit buttons. Or maybe the approach content moderation takes to render it's widget could be more explicit/configurable/robust so IEF specific fixes aren't required.
Hosting the patch here for my own reference and possibly a work around while this is addressed properly.
Comment #4
Sam152 CreditAttribution: Sam152 at PreviousNext commentedJust for the test bot.
Comment #5
Sam152 CreditAttribution: Sam152 at PreviousNext commentedComment #6
Sam152 CreditAttribution: Sam152 at PreviousNext commentedComment #7
Sam152 CreditAttribution: Sam152 at PreviousNext commentedComment #8
timmillwoodI've never used inline_entity_form so hard for me to comment, but we don't really want to add inline_entity_form specific changes in core.
I think we either need a generic way of making it work, or make the change in inline_entity_form itself.
Comment #9
dawehnerThere is one issue which wants to remove the little dropbutton we have for the publish/unpublish field, and instead provide an additional checkbox or so. I cannot find that particular issue at the moment, but when we would agree on that interaction pattern, content_moderation would not have to alter the submit button.
Comment #10
timmillwoodComment #12
darol100 CreditAttribution: darol100 as a volunteer and commented@Sam152 Great patch, something I notice is that when I am editing a draft of a node does not bring the draft version of the entity reference. Instead it bring the published of the entity_reference.
In my current use case this is a problem. I am not sure if this will be an expected behavior or if this should be even fix as part of this issue. What you folks think ?
Comment #13
Sam152 CreditAttribution: Sam152 at PreviousNext commentedInline entity form doesn't imply a composite relationship. You would need entity reference revisions for that. I've only tested this in the context of the inner entity being moderated and the parent not.
Comment #14
ansitun CreditAttribution: ansitun commentedPatch #2 will not be applicable to all entity references and their children as well (recursively) for a content type. I have create a patch that allows to have support for entity reference recursively, meaning that if there is an entity reference inside of another entity reference this will still add support of content moderation with inline edit form.
Comment #15
timmillwoodSpaces introduced.
Comment #16
timmillwoodBack to needs work.
Comment #17
darol100 CreditAttribution: darol100 as a volunteer and commentedThese patches seem to be outdated in 8.3.x. Instead having the states button, I am getting some weird auto-complete field.
Comment #18
Dinesh18 CreditAttribution: Dinesh18 as a volunteer commentedFixed the white-space errors as per #17. Here is the updated patch.
Comment #19
Dinesh18 CreditAttribution: Dinesh18 as a volunteer commentedComment #20
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedI'm pretty sure this will be fixed by #2753717: Add select field to choose moderation state on entity forms.
Comment #21
darol100 CreditAttribution: darol100 as a volunteer and commentedPlease ignore my comment from #17, that issue was unrelated to this patch.
@amateescu, I read issue #2753717: Add select field to choose moderation state on entity forms and it seem to be solving a different issue. This is temporary support for inline editing form. Just like @Sam152 mention on #3 this patch will never make it into core. For this reason, I am moving this patch into "Needs Review" so we can continue supporting this temporary solution until inline_editing_form support content_moderation.
Comment #23
timmillwoodThe widget has changed so much, we don't have processActions() anymore.
Don't need the 'Ø'.
Comment #24
timmillwood