We are running Drupal 8.8.1 with Content Moderation with 3 states: draft, needs review and published.
We are seeing issues with publishing changes: if you edit a draft, save and place it into "Needs Review", the changes are saved, but if you then publish it, the changes are disappear.
If however you edit a published page and save as published, the changes are saved.

Comments

rimbu002 created an issue. See original summary.

hchonov’s picture

Unfortunately the module currently does not automatically support forward revisions - something that content moderation relies on. We would the attention of someone knowing more of the interns of content moderation in order to make it work with conflict automatically.

joseph.olstad’s picture

yes I noticed this as well, for now we are uninstalling the conflict module. Our workflow has way more transitions than this and moderation states. I don't have the time right now to investigate.

bsfajardo’s picture

StatusFileSize
new2.49 KB

I think I found a fix for this. Per my investigation, the issue was in the hook_form_alter() implementation.

In this hook, the content entity extracted from the form object $form_object->getEntity() was not fully loaded with revision information, for some reason that is still not clear to me. In the conflict_prepare_entity_form() helper method, trying to execute $entity->isDefaultRevision() was always returning FALSE, causing the conflict support flag for the form to be disabled: $form_state->set('conflict.supported', FALSE).

My suggestion is to use the hook hook_entity_prepare_form() to update the conflict support flag based on the fully loaded entity object, and then let hook_form_alter() be called to apply the necessary updates in the form.

Patch is attached. Tested on Drupal 9.1.5 and Conflict 8.x-2.0-alpha2.