Problem/Motivation
ReplicateLayoutBuilderSubscriber listens to ReplicatorEvents::AFTER_SAVE and clones all the inline blocks in an entity layout before saving the entity again. This second save can create a revision if a Content Moderation workflow is enabled on the entity, resulting in a 2nd revision being created. This second revision doesn't have ->setRevisionTranslationAffected(TRUE) called on it, which means it won't show up in the revisions list.
I don't know too much about this flag. I think it's supposed to be calculated automatically if data on the entity has changed in the revision? I think it should be set. If the user goes to delete the original revision created from when the entity was first replicated, now the revisions list will be completely empty which is very confusing.
Steps to reproduce
Have a content type with a content moderation workflow enabled. Replicate a node from it. Observe that the replicated node has two revisions in the database, but only one (the original) shows in the revisions UI.
Proposed resolution
Call ->setRevisionTranslationAffected(TRUE) on the entity before saving in the the subscriber.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork replicate-3591625
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
bkosborne