diff -u b/core/modules/migrate/src/Plugin/migrate/destination/EntityConfigBase.php b/core/modules/migrate/src/Plugin/migrate/destination/EntityConfigBase.php --- b/core/modules/migrate/src/Plugin/migrate/destination/EntityConfigBase.php +++ b/core/modules/migrate/src/Plugin/migrate/destination/EntityConfigBase.php @@ -37,7 +37,7 @@ * The configuration factory. * * @var \Drupal\Core\Config\ConfigFactoryInterface; - */ + */ protected $configFactory; /** @@ -60,7 +60,7 @@ * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory * The configuration factory. */ - public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, EntityStorageInterface $storage, array $bundles, LanguageManagerInterface $language_manager, ConfigFactoryInterface $config_factory) { + public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, EntityStorageInterface $storage, array $bundles, LanguageManagerInterface $language_manager, ConfigFactoryInterface $config_factory) { parent::__construct($configuration, $plugin_id, $plugin_definition, $migration, $storage, $bundles); $this->languageManager = $language_manager; $this->configFactory = $config_factory; @@ -109,15 +109,12 @@ if (count($ids) > 1) { // This can only be a config entity, content entities have their ID key // and that's it. - $return = array(); + $return = []; foreach ($id_keys as $id_key) { - if ($this->isTranslationDestination()) { - if ($id_key == 'langcode') { - $return[] = $row->getDestinationProperty($id_key); - } - else { - $return[] = $entity->get($id_key); - } + if (($this->isTranslationDestination()) && ($id_key == 'langcode')) { + // Config entities do not have a language property, get the language + // code from the destination. + $return[] = $row->getDestinationProperty($id_key); } else { $return[] = $entity->get($id_key); @@ -125,7 +122,7 @@ } return $return; } - return array($entity->id()); + return [$entity->id()]; } /** @@ -162,7 +159,7 @@ // This is a translation if the language in the active config matches the // language of this row. $translation = FALSE; - if ($row->hasDestinationProperty('langcode') && $this->languageManager instanceof ConfigurableLanguageManager) { + if ($row->hasDestinationProperty('langcode') && $this->languageManager instanceof ConfigurableLanguageManager) { $config = $entity->getConfigDependencyName(); $langcode = $this->configFactory->get('langcode'); if ($langcode != $row->getDestinationProperty('langcode')) {