Does not seem to work with revisions

Created on 21 June 2023, over 1 year ago
Updated 14 September 2023, over 1 year ago

Hello !
First of all, thank you for sharing this!
Unfortunately, it does not seem to work with revisions yet. (Content Moderation & Workflows)
Can you confirm this?
Any tip to make it work with revisions?
FYI, so far I am already using setSyncing(TRUE) so that my small administrative updates on some fields do not create a new Revision each time.
My next goal as you can guess it to prevent these small updates to update the 'changed' timestamp of the revision...
Thanks !

💬 Support request
Status

Closed: works as designed

Version

2.0

Component

Code

Created by

🇫🇷France nicolas bouteille

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @nicolas bouteille
  • Status changed to Closed: works as designed over 1 year ago
  • 🇫🇷France nicolas bouteille

    It seems the problem was coming from my own custom wrapper function

    public function preserveChanged() {
        if ( property_exists($this->entity, 'changed')) {
          $this->entity->changed->preserve = TRUE;
        }
      }
    

    the property_exists was returning false all the time...
    this code works best:

    public function preserveChanged() {
        if ($this->entity instanceof FieldableEntityInterface && $this->entity->hasField('changed')) {
          $this->entity->get('changed')->preserve = TRUE;
        }
      }
    
Production build 0.71.5 2024