diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/source/ContentEntity.php b/core/modules/migrate_drupal/src/Plugin/migrate/source/ContentEntity.php index 607cc38..71b98af 100644 --- a/core/modules/migrate_drupal/src/Plugin/migrate/source/ContentEntity.php +++ b/core/modules/migrate_drupal/src/Plugin/migrate/source/ContentEntity.php @@ -142,13 +142,11 @@ protected function toArray(ContentEntityInterface $entity) { // This is necessary because the IDs must be flat. They cannot be nested for // the ID map. foreach (array_keys($this->getIds()) as $id) { - $reset = reset($return[$id]); + /** @var \Drupal\Core\TypedData\Plugin\DataType\ItemList $value */ + $value = $entity->get($id); // Force the IDs over top the previous values. unset($return[$id]); - $return[$id] = reset($reset); - if (empty($return[$id])) { - throw new EntityMalformedException(sprintf('Entity of type %s and id %s is missing its id.', $entity->getEntityTypeId(), $entity->id())); - } + $return[$id] = $value->first()->getString(); } return $return; }