diff --git a/core/modules/migrate_drupal_ui/css/components/upgrade-analysis-report-tables.css b/core/modules/migrate_drupal_ui/css/components/upgrade-analysis-report-tables.css index f15ff6a4b4..1de1a1ebed 100644 --- a/core/modules/migrate_drupal_ui/css/components/upgrade-analysis-report-tables.css +++ b/core/modules/migrate_drupal_ui/css/components/upgrade-analysis-report-tables.css @@ -18,3 +18,6 @@ .upgrade-analysis-report__status-icon--checked:before { background-image: url(../../../../misc/icons/73b355/check.svg); } +.upgrade-analysis-report__status-icon--error:before { + background-image: url(../../../../misc/icons/e32700/error.svg); +} diff --git a/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php index 6bfaf42f1d..28be388891 100644 --- a/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php +++ b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php @@ -2,6 +2,7 @@ namespace Drupal\migrate_drupal_ui\Form; +use Drupal\Component\Utility\Random; use Drupal\Core\Datetime\DateFormatterInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Form\ConfirmFormBase; @@ -13,6 +14,7 @@ use Drupal\migrate_drupal\Plugin\MigrateFieldPluginManagerInterface; use Drupal\migrate_drupal_ui\Batch\MigrateUpgradeImportBatch; use Drupal\migrate_drupal\MigrationConfigurationTrait; +use Drupal\migrate_drupal_ui\MigrateUpgrade; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -169,8 +171,8 @@ public function buildOverviewForm(array $form, FormStateInterface $form_state) { else { $form['info_header'] = [ '#markup' => '

' . $this->t('Upgrade a site by importing its files and the data from its database into a clean and empty new install of Drupal 8. See the Drupal site upgrades handbook for more information.', [ - ':url' => 'https://www.drupal.org/upgrade/migrate', - ]), + ':url' => 'https://www.drupal.org/upgrade/migrate', + ]), ]; $form['legend']['#markup'] = ''; @@ -535,17 +537,17 @@ public function buildConfirmForm(array $form, FormStateInterface $form_state) { '#title' => [ '#type' => 'html_tag', '#tag' => 'span', - '#value' => $this->t('Missing upgrade paths'), - '#attributes' => ['id' => ['warning']], + '#value' => $this->t('Modules that will not be upgraded'), + '#attributes' => ['id' => ['error']], ], - '#description' => $this->t('The following items will not be upgraded. For more information see Upgrading from Drupal 6 or 7 to Drupal 8.', [':migrate' => 'https://www.drupal.org/upgrade/migrate']), + '#description' => $this->t('The following modules will not be upgraded. For more information see Upgrading from Drupal 6 or 7 to Drupal 8.', [':migrate' => 'https://www.drupal.org/upgrade/migrate']), '#weight' => 2, ]; $missing_module_list['module_list'] = [ '#type' => 'table', '#header' => [ - $this->t('Source module: Drupal @version', ['@version' => $version]), - $this->t('Upgrade module: Drupal 8'), + $this->t('Drupal @version', ['@version' => $version]), + $this->t('Drupal 8'), ], ]; $missing_count = 0; @@ -561,31 +563,33 @@ public function buildConfirmForm(array $form, FormStateInterface $form_state) { '#attributes' => [ 'class' => [ 'upgrade-analysis-report__status-icon', - 'upgrade-analysis-report__status-icon--warning', + 'upgrade-analysis-report__status-icon--error', ], ], ], - 'destination_module' => ['#plain_text' => 'Missing'], + 'destination_module' => ['#plain_text' => 'Not upgraded'], ]; } } + // Available migrations. $available_module_list = [ '#type' => 'details', '#title' => [ '#type' => 'html_tag', '#tag' => 'span', - '#value' => $this->t('Available upgrade paths'), + '#value' => $this->t('Modules that will be upgraded'), '#attributes' => ['id' => ['checked']], ], + '#description' => $this->t('This is a list of the modules that will be upgraded and the Drupal 8 module or modules it will be upgraded to.'), '#weight' => 3, ]; $available_module_list['module_list'] = [ '#type' => 'table', '#header' => [ - $this->t('Source module: Drupal @version', ['@version' => $version]), - $this->t('Upgrade module: Drupal 8'), + $this->t('Drupal @version', ['@version' => $version]), + $this->t('Drupal 8'), ], ]; @@ -622,8 +626,8 @@ public function buildConfirmForm(array $form, FormStateInterface $form_state) { $counters[] = [ '#theme' => 'status_report_counter', '#amount' => $missing_count, - '#text' => $this->formatPlural($missing_count, 'Missing upgrade path', 'Missing upgrade paths'), - '#severity' => 'warning', + '#text' => $this->formatPlural($missing_count, 'Module will not be upgraded', 'Modules will not be upgraded'), + '#severity' => 'error', '#weight' => 0, ]; $general_info[] = $missing_module_list; @@ -632,12 +636,16 @@ public function buildConfirmForm(array $form, FormStateInterface $form_state) { $counters[] = [ '#theme' => 'status_report_counter', '#amount' => $available_count, - '#text' => $this->formatPlural($available_count, 'Available upgrade path', 'Available upgrade paths'), + '#text' => $this->formatPlural($available_count, 'Module will be upgraded', 'Modules will be upgraded'), '#severity' => 'checked', '#weight' => 1, ]; $general_info[] = $available_module_list; } + $form['upgrade_option_item'] = [ + '#type' => 'item', + '#description' => $this->t('Here is a summary of the upgrade status for all installed modules on the old site.'), + ]; $form['status_report_page'] = [ '#theme' => 'status_report_page', @@ -697,7 +705,7 @@ protected function getDatabaseTypes() { * {@inheritdoc} */ public function getQuestion() { - return $this->t('Upgrade analysis report'); + return $this->t('Pre upgrade analysis'); } /** 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 d5cc93908a..b6dc9715c9 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php @@ -154,7 +154,7 @@ public function testMigrateUpgrade() { $this->drupalPostForm(NULL, $edits, t('Review upgrade')); $this->assertResponse(200); - $this->assertText('Upgrade analysis report'); + $this->assertText('Pre upgrade analysis'); // Ensure we get errors about missing modules. $this->assertSession()->pageTextContains(t('Source module not found for migration_provider_no_annotation.')); $this->assertSession()->pageTextContains(t('Source module not found for migration_provider_test.')); @@ -173,7 +173,7 @@ public function testMigrateUpgrade() { $this->drupalPostForm(NULL, $edits, t('Review upgrade')); $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->pageTextContains('Upgrade analysis report'); + $this->assertSession()->pageTextContains('Pre upgrade analysis'); // Ensure there are no errors about the missing modules from the test module. $this->assertSession()->pageTextNotContains(t('Source module not found for migration_provider_no_annotation.')); $this->assertSession()->pageTextNotContains(t('Source module not found for migration_provider_test.')); @@ -186,13 +186,13 @@ public function testMigrateUpgrade() { $session = $this->assertSession(); foreach ($all_available as $available) { $session->elementExists('xpath', "//span[contains(@class, 'checked') and text() = '$available']"); - $session->elementNotExists('xpath', "//span[contains(@class, 'warning') and text() = '$available']"); + $session->elementNotExists('xpath', "//span[contains(@class, 'error') and text() = '$available']"); } // Test the missing migration paths. $all_missing = $this->getMissingPaths(); foreach ($all_missing as $missing) { - $session->elementExists('xpath', "//span[contains(@class, 'warning') and text() = '$missing']"); + $session->elementExists('xpath', "//span[contains(@class, 'error') and text() = '$missing']"); $session->elementNotExists('xpath', "//span[contains(@class, 'checked') and text() = '$missing']"); }