diff --git a/core/lib/Drupal/Core/Database/Install/Tasks.php b/core/lib/Drupal/Core/Database/Install/Tasks.php index ee9c23e..409c859 100644 --- a/core/lib/Drupal/Core/Database/Install/Tasks.php +++ b/core/lib/Drupal/Core/Database/Install/Tasks.php @@ -148,14 +148,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/system/src/Tests/Installer/InstallerNotValidDatabaseSettingsTest.php b/core/modules/system/src/Tests/Installer/InstallerNotValidDatabaseSettingsTest.php new file mode 100644 index 0000000..a104368 --- /dev/null +++ b/core/modules/system/src/Tests/Installer/InstallerNotValidDatabaseSettingsTest.php @@ -0,0 +1,53 @@ +settings['databases']['default'] = (object) array( + 'value' => $connection_info, + 'required' => TRUE, + ); + parent::setUp(); + } + + /** + * For testing database failures. + */ + protected function setupSettings() { + // All database settings should be pre-configured, except password. + $values = $this->parameters['forms']['install_settings_form']; + $driver = $values['driver']; + $edit = array(); + $edit = $this->translatePostValues(array( + $driver => array( + 'password' => $this->randomMachineName(), + ), + )); + $this->drupalPostForm(NULL, $edit, $this->translations['Save and continue']); + } + +}