diff -u b/core/modules/migrate_drupal/migrate_drupal.module b/core/modules/migrate_drupal/migrate_drupal.module --- b/core/modules/migrate_drupal/migrate_drupal.module +++ b/core/modules/migrate_drupal/migrate_drupal.module @@ -46,7 +46,8 @@ ], ]; $vocabulary_migration = \Drupal::service('plugin.manager.migration')->createStubMigration($vocabulary_migration_definition); - $translation_active = \Drupal::service('module_handler')->moduleExists('config_translation'); + $module_handler = \Drupal::service('module_handler'); + $translation_active = $module_handler->moduleExists('config_translation') && $module_handler->moduleExists('content_translation'); try { $source_plugin = $vocabulary_migration->getSourcePlugin(); @@ -66,17 +67,19 @@ $plugin_ids[] = 'd6_term_node_translation:' . $source_vid; } foreach ($plugin_ids as $plugin_id) { - // Match the field name derivation in d6_vocabulary_field.yml. - $field_name = substr('field_' . $row->getDestinationProperty('vid'), 0, 32); + if (isset($definitions[$plugin_id])) { + // Match the field name derivation in d6_vocabulary_field.yml. + $field_name = substr('field_' . $row->getDestinationProperty('vid'), 0, 32); - // The Forum module is expecting 'taxonomy_forums' as the field name - // for the forum nodes. The 'forum_vocabulary' source property is - // evaluated in Drupal\taxonomy\Plugin\migrate\source\d6\Vocabulary - // and is set to true if the vocabulary vid being migrated is the - // same as the one in the 'forum_nav_vocabulary' variable on the - // source site. - $destination_vid = $row->getSourceProperty('forum_vocabulary') ? 'taxonomy_forums' : $field_name; - $definitions[$plugin_id]['process'][$destination_vid] = 'tid'; + // The Forum module is expecting 'taxonomy_forums' as the field name + // for the forum nodes. The 'forum_vocabulary' source property is + // evaluated in Drupal\taxonomy\Plugin\migrate\source\d6\Vocabulary + // and is set to true if the vocabulary vid being migrated is the + // same as the one in the 'forum_nav_vocabulary' variable on the + // source site. + $destination_vid = $row->getSourceProperty('forum_vocabulary') ? 'taxonomy_forums' : $field_name; + $definitions[$plugin_id]['process'][$destination_vid] = 'tid'; + } } } } @@ -113,28 +116,28 @@ if (isset($definitions['d6_comment'])) { $tmp = $definitions['d6_comment']['process']['entity_id'][0]['migration']; - $definitions['d6_comment']['process']['entity_id'][0]['migration'] = _insert_migration($tmp);; + $definitions['d6_comment']['process']['entity_id'][0]['migration'] = _insert_migration($tmp); } if (isset($definitions['d6_term_node'])) { $tmp = $definitions['d6_term_node']['process']['nid'][0]['migration']; - $definitions['d6_term_node']['process']['nid'][0]['migration'] = _insert_migration($tmp);; + $definitions['d6_term_node']['process']['nid'][0]['migration'] = _insert_migration($tmp); } if (isset($definitions['d6_term_node_revision'])) { $tmp = $definitions['d6_term_node_revision']['process']['vid'][0]['migration']; - $definitions['d6_term_node_revision']['process']['vid'][0]['migration'] = _insert_migration($tmp);; + $definitions['d6_term_node_revision']['process']['vid'][0]['migration'] = _insert_migration($tmp); } if (isset($definitions['d6_term_node_translation'])) { $tmp = $definitions['d6_term_node_translation']['process']['dest_nid'][0]['migration']; - $definitions['d6_term_node_translation']['process']['dest_nid'][0]['migration'] = _insert_migration($tmp);; + $definitions['d6_term_node_translation']['process']['dest_nid'][0]['migration'] = _insert_migration($tmp); } if (isset($definitions['d6_url_alias'])) { $tmp = $definitions['d6_url_alias']['process']['node_translation'][2]['migration']; - $definitions['d6_url_alias']['process']['node_translation'][2]['migration'] = _insert_migration($tmp);; + $definitions['d6_url_alias']['process']['node_translation'][2]['migration'] = _insert_migration($tmp); } if (isset($definitions['d7_comment'])) { $tmp = $definitions['d7_comment']['process']['entity_id'][0]['migration']; - $definitions['d7_comment']['process']['entity_id'][0]['migration'] = _insert_migration($tmp);; + $definitions['d7_comment']['process']['entity_id'][0]['migration'] = _insert_migration($tmp); } if (isset($definitions['d7_url_alias'])) { $tmp = $definitions['d7_url_alias']['process']['node_translation'][2]['migration'];