diff --git a/core/lib/Drupal/Core/Database/Install/Tasks.php b/core/lib/Drupal/Core/Database/Install/Tasks.php index ee9c23e..9cbd50f 100644 --- a/core/lib/Drupal/Core/Database/Install/Tasks.php +++ b/core/lib/Drupal/Core/Database/Install/Tasks.php @@ -7,7 +7,6 @@ namespace Drupal\Core\Database\Install; -use Drupal\Component\Utility\SafeMarkup; use Drupal\Core\Database\Database; /** @@ -148,14 +147,19 @@ public function runTasks() { } } // Check for failed results and compile message - $message = ''; + $errors = []; foreach ($this->results as $result => $success) { if (!$success) { - $message = SafeMarkup::isSafe($result) ? $result : SafeMarkup::checkPlain($result); + $errors[] = $result; } } - if (!empty($message)) { - $message = SafeMarkup::set('Resolve all issues below to continue the installation. For help configuring your database server, see the installation handbook, or contact your hosting provider.' . $message); + if ($errors) { + $error_list = [ + '#theme' => 'item_list', + '#items' => $errors, + ]; + $error_list = \Drupal::service('renderer')->renderPlain($error_list); + $message = t('Resolve all issues below to continue the installation. For help configuring your database server, see the installation handbook, or contact your hosting provider.@errors', ['@errors' => $error_list]); throw new TaskException($message); } } diff --git a/core/modules/simpletest/src/InstallerTestBase.php b/core/modules/simpletest/src/InstallerTestBase.php index c340c92..88fabab 100644 --- a/core/modules/simpletest/src/InstallerTestBase.php +++ b/core/modules/simpletest/src/InstallerTestBase.php @@ -72,6 +72,13 @@ protected $isInstalled = FALSE; /** + * Whether to bail right after configuring the settings in the installer. + * + * @var bool + */ + protected $testSetUpSettingsOnly = FALSE; + + /** * Overrides WebTestBase::setUp(). */ protected function setUp() { @@ -131,6 +138,9 @@ protected function setUp() { // Configure settings. $this->setUpSettings(); + if ($this->testSetUpSettingsOnly === TRUE) { + return; + } // @todo Allow test classes based on this class to act on further installer // screens. diff --git a/core/modules/system/src/Tests/Installer/InstallerDatabaseErrorMessagesTest.php b/core/modules/system/src/Tests/Installer/InstallerDatabaseErrorMessagesTest.php new file mode 100644 index 0000000..923d4dc --- /dev/null +++ b/core/modules/system/src/Tests/Installer/InstallerDatabaseErrorMessagesTest.php @@ -0,0 +1,39 @@ +query('CREATE TABLE {drupal_install_test} (id int NULL)'); + parent::setUpSettings(); + $this->assertRaw('