diff --git a/core/modules/migrate_drupal_ui/src/Form/CredentialForm.php b/core/modules/migrate_drupal_ui/src/Form/CredentialForm.php index f272e7e6cf..64ba59e42e 100644 --- a/core/modules/migrate_drupal_ui/src/Form/CredentialForm.php +++ b/core/modules/migrate_drupal_ui/src/Form/CredentialForm.php @@ -195,17 +195,17 @@ public function validateForm(array &$form, FormStateInterface $form_state) { // Cut the trailing \Install from namespace. $database['namespace'] = substr($install_namespace, 0, strrpos($install_namespace, '\\')); $database['driver'] = $driver; - + $errors = $drivers[$driver]->validateDatabaseSettings($database); try { $connection = $this->getConnection($database); $version = (string) $this->getLegacyDrupalVersion($connection); if (!$version) { - $errors['driver' . '][0'] = $this->t('Source database does not contain a recognizable Drupal version.'); + $errors[$driver . '][0'] = $this->t('Source database does not contain a recognizable Drupal version.'); } elseif ($version !== (string) $form_state->getValue('version')) { - $errors['driver' . '][0'] = $this->t('Source database is Drupal version @version but version @selected was selected.', + $errors[$driver . '][0'] = $this->t('Source database is Drupal version @version but version @selected was selected.', [ '@version' => $version, '@selected' => $form_state->getValue('version'), @@ -217,7 +217,7 @@ public function validateForm(array &$form, FormStateInterface $form_state) { } } catch (\Exception $e) { - $errors['driver' . '][0'] = $e->getMessage(); + $errors[$driver . '][0'] = $e->getMessage(); } // Check that sources files are available. @@ -262,7 +262,7 @@ public function validateForm(array &$form, FormStateInterface $form_state) { * @param \Drupal\Core\Form\FormStateInterface $form_state * The form state. */ - protected function buildErrorList($errors, FormStateInterface $form_state) { + protected function buildErrorList(array $errors, FormStateInterface $form_state) { $items = []; foreach ($errors as $name => $message) { $form_state->setErrorByName($name);