core/modules/path/path.module | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/core/modules/path/path.module b/core/modules/path/path.module index f465085492..5f1a4a1277 100644 --- a/core/modules/path/path.module +++ b/core/modules/path/path.module @@ -181,6 +181,21 @@ function path_migration_plugins_alter(array &$migrations) { if ($destination_plugin === 'entity:path_alias') { $path_alias_destination_migration_ids[] = $migration_plugin_id; + // The `d7_url_alias` migration definition supports node translations, + // but it should only specify this in its process pipeline for the + // derived migration definitions that actually targets nodes. Otherwise, + // all derivatives still end up depending on the node migrations. + // @see \Drupal\path\Plugin\migrate\D7PathAliasDeriver + // @see \Drupal\migrate\Plugin\Migration::getMigrationDependencies() + // @see \Drupal\migrate\Plugin\Migration::findMigrationDependencies() + if ($migration['id'] == 'd7_url_alias' && (!isset($migration['source']['entity_type_id']) || $migration['source']['entity_type_id'] !== 'node')) { + $migration['process']['path'] = $migration['process']['_path']; + $migration['process']['langcode'] = 'language'; + unset($migration['process']['node_translation']); + unset($migration['process']['_path']); + $migrations[$migration_plugin_id] = $migration; + } + // Track which entity type IDs should be used as required dependencies // instead of optional. Here we just pre-populate with an empty array. if (!empty($migration['source']['entity_type_id']) && !isset($optional_migrations_per_entity_type[$migration['source']['entity_type_id']])) {