TypeError when importing entity with moderation_state

Created on 14 August 2025, 12 days ago

Problem/Motivation

When testing the module I exported a Microcontent entity that had content moderation enabled. When importing, a PHP type error was thrown with:

TypeError: Drupal\single_content_sync\Plugin\SingleContentSyncFieldProcessor\GenericField::importFieldValue(): Argument #3 ($value) must be of type array, string given, called in /data/app/modules/contrib/single_content_sync/src/ContentImporter.php on line 334 in Drupal\single_content_sync\Plugin\SingleContentSyncFieldProcessor\GenericField->importFieldValue() (line 29 of modules/contrib/single_content_sync/src/Plugin/SingleContentSyncFieldProcessor/GenericField.php). 

Debugging this is interesting as it seems like this works fine for Node entities (presumably some special handling with the base field)

Steps to reproduce

Export a microcontent entity with content moderation enabled on it.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.4

Component

Code

Created by

🇦🇺Australia acbramley

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

Comments & Activities

Production build 0.71.5 2024