Migrated content becomes Unpublished when Content Moderation Workflow exists for content type

Created on 6 July 2020, over 4 years ago
Updated 11 April 2024, 9 months ago

When you migrate nodes of a certain content type from, say D7, into D8.9 (using the migrate_upgrade module) and on the D8 site the Content Moderation module is enabled with a Workflow defined for that content type, then ALL entities (eg. nodes) of the content type will be saved with their "status" (Published flag) OFF (FALSE) and their workflow state set to Draft, regardless of whether those nodes were Published or Unpublished on the D7 site (which of course does not have Content Moderation, as it did not exist before D8).

The desired behaviour is that migrated/imported content has its Published/Unpublished status flag set identical to the source (D7)
and that the generated workflow state in D8 is consistent with that status flag. This means: a workflow state of Published when the status flag is Published (TRUE) and a workflow state of Draft when status equals Unpublished (FALSE).

Patch to follow.

πŸ› Bug report
Status

Closed: works as designed

Version

8.9 ⚰️

Component
Content moderationΒ  β†’

Last updated 21 days ago

  • Maintained by
  • πŸ‡¦πŸ‡ΊAustralia @Sam152
Created by

πŸ‡¦πŸ‡ΊAustralia rdeboer Melbourne

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡«πŸ‡·France pacproduct

    @Sam152 thanks, your solution works great.

    I only had to adjust slightly the source in our case (state => status), with our generated migrations from a D6 site:

    process:
    [...]
      moderation_state:
        plugin: static_map
        source: status
        default_value: draft
        map:
          '0': draft
          '1': published
    
  • πŸ‡ΊπŸ‡ΈUnited States jeffreysmattson

    @Sam152 and @pacproduct, Your solutions worked for me on D7 -> D10, thanks for posting. Never would have made it there without you. :-)

  • πŸ‡¬πŸ‡§United Kingdom Finn Lewis

    Ditto @Sam152 and @pacproduct - worked a treat! I owe you a beer!

Production build 0.71.5 2024