Issue #3089747: Content moderation can wrongly set old revisions as default when they're resaved
Merge request reports
Activity
88 94 $node->getTranslation($langcode)->$name = $value; 89 95 } 90 96 } 97 $node->setSyncing($syncing); setSyncing is the right state in this case, so I think we should leave in this state, please see the change record https://www.drupal.org/node/3052114
New revisions are created every time an entity or revision is updated, if that entity is being moderated with content moderation. Previously there was no way to opt out of this. By using SynchronizableInterface, users can now mark an entity as 'syncing' to indicate changes are being made to the entity which do not reflect a typical content/editorial field based change and thus should not be subject to the entity lifecycle rules content moderation enforces.
I think I didn't phrase that well enough. Consider this:
In
_node_mass_update_helper
$node->setSyncing(TRUE);
...later on in another module's hook that fires after content moderation
$node = some_function_that_loads_the_same_node(); $node->set('field_x'); $node->save(); <-- Will the syncing flag set in the content moderation hook apply here? Is that flag statically cached in the request along with the rest of the entity?
...or to make it safer, would we have to do this in
_node_mass_update_helper
:$original_state = $node->isSyncing(); $node->setSyncing(TRUE); $node->save(); $node->setSyncing($original_state);
in order to prevent the syncing status from "leaking out" into the rest of the request?
added 131 commits
-
63a179a4...cb55a3ae - 130 commits from branch
project:11.x
- 383ad2e6 - Merge branch '11.x' into drupal-3089747
-
63a179a4...cb55a3ae - 130 commits from branch
mentioned in merge request !4713