diff --git a/core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php b/core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php index 66ea711..ff0e26d 100644 --- a/core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php +++ b/core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php @@ -88,6 +88,10 @@ public function import(Row $row, array $old_destination_id_values = []) { throw new MigrateException('Unable to get entity'); } + if ($this->needsValidation()) { + $this->validateEntity($entity); + } + $ids = $this->save($entity, $old_destination_id_values); if (!empty($this->configuration['translations'])) { $ids[] = $entity->language()->getId(); @@ -107,9 +111,6 @@ public function import(Row $row, array $old_destination_id_values = []) { * An array containing the entity ID. */ protected function save(ContentEntityInterface $entity, array $old_destination_id_values = []) { - if ($this->needsValidation()) { - $this->validateEntity($entity); - } $entity->save(); return [$entity->id()]; }