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

merge-requests/1654/head
Francesco Placella 2018-03-12 12:40:14 +01:00
parent 6f9980fc82
commit fe1e9a57c4
2 changed files with 23 additions and 1 deletions

View File

@ -237,7 +237,7 @@ class ReviewForm extends MigrateUpgradeFormBase {
// 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;
}
}

View File

@ -112,6 +112,28 @@ abstract class MigrateUpgradeReviewPageTestBase extends MigrateUpgradeTestBase {
$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);
}
/**