diff --git a/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php b/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php index 3f7bcb7..98485e8 100644 --- a/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php +++ b/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php @@ -954,7 +954,7 @@ function (array $id) { // If there's a bundle, it means we have a derived migration and we need to // find all the mapping tables from the related derived migrations. - if ($base_id = substr($migration_id, 0, strpos($migration_id, ':'))) { + if ($base_id = substr($migration_id, 0, strpos($migration_id, static::DERIVATIVE_SEPARATOR))) { // @TODO Inject the plugin manager as a dependency. /** @var \Drupal\migrate\Plugin\MigrationPluginManagerInterface $migration_manager */ $migration_manager = \Drupal::service('plugin.manager.migration'); diff --git a/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php index 302fe62..784281f 100644 --- a/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php +++ b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php @@ -460,33 +460,33 @@ public function buildIdConflictForm(array &$form, FormStateInterface $form_state $migrations = $this->pluginManager->createInstances($migration_ids); $auditor = new IdAuditor(); - $i18n = $conflicts = []; + $translated_content_conflicts = $content_conflicts = []; foreach ($migrations as $migration) { $audit = $auditor->audit($migration); $destination_plugin = $migration->getDestinationPlugin(); if ($destination_plugin instanceof EntityContentBase && $destination_plugin->isTranslationDestination()) { - $i18n += $audit; + $translated_content_conflicts += $audit; } else { - $conflicts += $audit; + $content_conflicts += $audit; } } - if (empty($conflicts) && empty($i18n)) { + if (empty($content_conflicts) && empty($translated_content_conflicts)) { $form_state->set('step', 'confirm'); return $this->buildForm($form, $form_state); } $form['warning'] = [ '#type' => 'markup', - '#markup' => '

' . $this->t('Entities may be overwritten') . '

', + '#markup' => '

' . $this->t('Content may be overwritten') . '

', ]; $form = parent::buildForm($form, $form_state); $form['actions']['submit']['#submit'] = ['::submitConfirmIdConflictForm']; $form['actions']['submit']['#value'] = $this->t('I acknowledge I may lose data, continue anyway.'); - $form = $this->conflictsForm($form, $form_state, $conflicts); - return $this->i18nWarningForm($form, $form_state, $i18n); + $form = $this->conflictsForm($form, $form_state, $content_conflicts); + return $this->i18nWarningForm($form, $form_state, $translated_content_conflicts); } /** @@ -496,24 +496,24 @@ public function buildIdConflictForm(array &$form, FormStateInterface $form_state * An associative array containing the structure of the form. * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. - * @param array $conflicts + * @param array $content_conflicts * The conflicted migration labels. * * @return array * The form structure. */ - protected function conflictsForm(array &$form, FormStateInterface $form_state, $conflicts) { - if (empty($conflicts)) { + protected function conflictsForm(array &$form, FormStateInterface $form_state, $content_conflicts) { + if (empty($content_conflicts)) { return $form; } - $form['warning']['#markup'] .= '

' . $this->t('Upgrades work on brand new sites, or sites with previously upgraded data. However, it looks like you have content in your site that is unknown to the migrate system; perhaps manually added. These new entities may be overwritten if you run this upgrade. For more information, see the online handbook entry for handling migration conflicts.', [':id-conflicts-handbook' => 'https://www.drupal.org/docs/8/upgrade/known-issues-when-upgrading-from-drupal-6-or-7-to-drupal-8#id_conflicts']) . '

'; + $form['warning']['#markup'] .= '

' . $this->t('Upgrades work on clean and empty new installs of Drupal 8. However, it looks like you have content in your site that is unknown to the migrate system; perhaps manually added. These new entities may be overwritten if you run this upgrade. For more information, see the online handbook entry for handling migration conflicts.', [':id-conflicts-handbook' => 'https://www.drupal.org/docs/8/upgrade/known-issues-when-upgrading-from-drupal-6-or-7-to-drupal-8#id_conflicts']) . '

'; - sort($conflicts); + sort($content_conflicts); $form['conflicts'] = [ - '#title' => $this->t('The conflicting entities are of the following types:'), + '#title' => $this->t('The conflicting content are of the following types:'), '#theme' => 'item_list', - '#items' => $conflicts, + '#items' => $content_conflicts, ]; return $form; @@ -526,24 +526,24 @@ protected function conflictsForm(array &$form, FormStateInterface $form_state, $ * An associative array containing the structure of the form. * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. - * @param array $i18n - * The internationalization migration labels. + * @param array $translated_content_conflicts + * The conflicted translated migration labels. * * @return array * The form structure. */ - protected function i18nWarningForm(array &$form, FormStateInterface $form_state, $i18n) { - if (empty($i18n)) { + protected function i18nWarningForm(array &$form, FormStateInterface $form_state, $translated_content_conflicts) { + if (empty($translated_content_conflicts)) { return $form; } $form['warning']['#markup'] .= '

' . $this->t('It looks like you are migrating translated content. Be extra cautious and make sure you aren\'t introducting any conflicts. For more on the subject, see the online handbook entry for handling migration conflicts.', [':id-conflicts-handbook' => 'https://www.drupal.org/docs/8/upgrade/known-issues-when-upgrading-from-drupal-6-or-7-to-drupal-8#id_conflicts']) . '

'; - sort($i18n); + sort($translated_content_conflicts); $form['i18n'] = [ - '#title' => $this->t('The translatable entities are of the following types:'), + '#title' => $this->t('The translated content are of the following types:'), '#theme' => 'item_list', - '#items' => $i18n, + '#items' => $translated_content_conflicts, ]; return $form; diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php index 610e339..46d8303 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php @@ -152,7 +152,7 @@ public function testMigrateUpgrade() { $this->drupalPostForm(NULL, $edits, t('Review upgrade')); $this->assertResponse(200); - $this->assertSession()->pageTextContains('Entities may be overwritten'); + $this->assertSession()->pageTextContains('Content may be overwritten'); $this->drupalPostForm(NULL, [], t('I acknowledge I may lose data, continue anyway.')); // Ensure we get errors about missing modules. $this->assertSession()->pageTextContains('Upgrade analysis report'); @@ -173,7 +173,7 @@ public function testMigrateUpgrade() { $this->drupalPostForm(NULL, $edits, t('Review upgrade')); $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextContains('Entities may be overwritten'); + $this->assertSession()->pageTextContains('Content may be overwritten'); $this->drupalPostForm(NULL, [], t('I acknowledge I may lose data, continue anyway.')); // Ensure there are no errors about the missing modules from the test module. $this->assertSession()->pageTextContains('Upgrade analysis report'); diff --git a/core/modules/user/migration_templates/d7_user.yml b/core/modules/user/migration_templates/d7_user.yml index 5c5e545..c93288f 100644 --- a/core/modules/user/migration_templates/d7_user.yml +++ b/core/modules/user/migration_templates/d7_user.yml @@ -3,7 +3,7 @@ label: User accounts audit: true migration_tags: - Drupal 7 -class: '\Drupal\user\Plugin\migrate\User' +class: \Drupal\user\Plugin\migrate\User source: plugin: d7_user process: