Skip to content
Snippets Groups Projects

#2869056: Automatically set revision user/log information/created time on entity revisions

Open #2869056: Automatically set revision user/log information/created time on entity revisions
4 unresolved threads
4 unresolved threads
Files
7
@@ -476,6 +476,12 @@ public function preSave(EntityStorageInterface $storage) {
$this->validated = FALSE;
}
// If no revision author has been set explicitly, make the current user the
// revision author.
if ($this instanceof RevisionLogInterface && !$this->getRevisionUser()) {
    • So the test failure is because the revision user is set at this point. I don't know the rationale for putting this logic here and not alongside the other stuff in EditorialContentEntityBase but I also tried moving this there and it has the same issue - the revision user from the previous revision is still set.

      Haven't found where the revision_created field gets cleared on a new revision yet.

      • ...and changing to current user has caused a mass amount of failures. Maybe we should keep author? I'm unsure now. We can't keep it at author as that doesn't change from revision to revision.

        Edited by Adam Bramley
      • Please register or sign in to reply
Please register or sign in to reply
$this->setRevisionUserId(\Drupal::currentUser()->id());
}
parent::preSave($storage);
}
Loading