diff --git a/core/modules/migrate/src/Plugin/migrate/destination/Entity.php b/core/modules/migrate/src/Plugin/migrate/destination/Entity.php index 4ff2016..9abf888 100644 --- a/core/modules/migrate/src/Plugin/migrate/destination/Entity.php +++ b/core/modules/migrate/src/Plugin/migrate/destination/Entity.php @@ -114,7 +114,7 @@ protected function getEntity(Row $row, array $old_destination_id_values) { $values = $row->getDestination(); // Stubs might not have the bundle specified. if ($row->stub()) { - $this->processStubValues($values); + $values = $this->processStubValues($values); } $entity = $this->storage->create($values); $entity->enforceIsNew(); @@ -127,17 +127,19 @@ protected function getEntity(Row $row, array $old_destination_id_values) { * * @param array $values * An array of destination values. + * + * @return array + * The processed stub values. */ - protected function processStubValues(array &$values) { + protected function processStubValues(array $values) { + $values = array_intersect_key($values, $this->getIds()); + $bundle_key = $this->getKey('bundle'); if ($bundle_key && !isset($values[$bundle_key])) { $values[$bundle_key] = reset($this->bundles); } - $remove_keys = array_intersect_key($this->migration->get('process'), $this->getIds()); - foreach ($remove_keys as $key => $value) { - unset($values[$key]); - } + return $values; } /**