Commit fe1e9a57 authored by plach's avatar plach

Issue #2951684 by alexpott, quietone: Undefined index ReviewForm->buildForm() line 240

parent 6f9980fc
......@@ -237,7 +237,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
// Add source_module and destination_module for modules that do not need an
// upgrade path and are enabled on the source site.
foreach ($this->noUpgradePaths[$version] as $extension) {
if ($system_data['module'][$extension]['status']) {
if (isset($system_data['module'][$extension]) && $system_data['module'][$extension]['status']) {
$table_data[$extension]['core'][$extension] = $extension;
}
}
......
......@@ -112,6 +112,28 @@ public function testMigrateUpgradeReviewPage() {
$available_paths = $this->getAvailablePaths();
$missing_paths = $this->getMissingPaths();
$this->assertUpgradePaths($session, $available_paths, $missing_paths);
// Check there are no errors when a module in noUpgradePaths is not in the
// source system tables. Test with a module that is listed in noUpgradePaths
// for both Drupal 6 and Drupal 7.
// @see \Drupal\migrate_drupal_ui\Form\ReviewForm::$noUpgradePaths
$module = 'help';
$query = $this->sourceDatabase->delete('system');
$query->condition('type', 'module');
$query->condition('name', $module);
$query->execute();
// Start the upgrade process.
$this->drupalGet('/upgrade');
$this->drupalPostForm(NULL, [], t('Continue'));
$this->drupalPostForm(NULL, $edits, t('Review upgrade'));
$this->drupalPostForm(NULL, [], t('I acknowledge I may lose data. Continue anyway.'));
// Test the upgrade paths.
$available_paths = $this->getAvailablePaths();
$available_paths = array_diff($available_paths, [$module]);
$missing_paths = $this->getMissingPaths();
$this->assertUpgradePaths($session, $available_paths, $missing_paths);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment