Referenced node entities not imported on content moderation state content type..

Comments

sivaguru_drupal created an issue. See original summary.

simoneb’s picture

Any news on this one? still happening

kentr’s picture

ramuchidambaram’s picture

This issue still exists. If we enable content moderation for a content type we are unable to import content moderation.
We are getting the following error
Error: Call to undefined method stdClass::save() in Drupal\content_moderation\Entity\ContentModerationState->save() (line 181 of /var/www/html/sharaf-dg-drupal/core/modules/content_moderation/src/Entity/ContentModerationState.php) #0 /var/www/html/sharaf-dg-drupal/modules/contrib/content_sync/src/Importer/ContentImporter.php(170): Drupal\content_moderation\Entity\ContentModerationState->save()

blanca.esqueda’s picture

Notes:
I did some troubleshooting.
- content moderation YML has hard ‘references’ to the entity and the revision. They are considered integer fields, it is why they don’t get changed to the UUID and Type format. [possible solution: normalize/denormalize the entity/fields for import/export]

- The tricky part will be to handle the revisions, I have to double check but I think entity revisions are never exported/imported.. I believe Revisions are skipped because when saving an entity in the target site a revision is added by default.. So:
Should entity revisions be exported/imported or skipped? If skipped, exporting/importing content moderation states won’t make sense.

blanca.esqueda’s picture

Version: 8.x-2.0 » 4.0.x-dev
Component: Code » Module Integration