Unverified Commit c8e85e37 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2678510 by larowlan, quietone, ankithashetty, samiullah, alexpott:...

Issue #2678510 by larowlan, quietone, ankithashetty, samiullah, alexpott: Remove @todos from migrate credentials form

(cherry picked from commit a5ef3af6)
parent 4eff6f74
Loading
Loading
Loading
Loading
+3 −9
Original line number Diff line number Diff line
@@ -90,11 +90,6 @@ public function buildForm(array $form, FormStateInterface $form_state) {

    $drivers = $this->getDatabaseTypes();
    $drivers_keys = array_keys($drivers);
    // @todo https://www.drupal.org/node/2678510 Because this is a multi-step
    //   form, the form is not rebuilt during submission. Ideally we would get
    //   the chosen driver from form input, if available, in order to use
    //   #limit_validation_errors in the same way
    //   \Drupal\Core\Installer\Form\SiteSettingsForm does.
    $default_driver = current($drivers_keys);

    $default_options = [];
@@ -136,10 +131,9 @@ public function buildForm(array $form, FormStateInterface $form_state) {
      $form['database']['settings'][$key] = $driver->getFormOptions($default_options);
      unset($form['database']['settings'][$key]['advanced_options']['prefix']['#description']);

      // @todo https://www.drupal.org/node/2678510 Using
      //   #limit_validation_errors in the submit does not work so it is not
      //   possible to require the database and username for mysql and pgsql.
      //   This is because this is a multi-step form.
      // This is a multi-step form and is not rebuilt during submission so
      // #limit_validation_errors is not used. The database and username fields
      // for mysql and pgsql must not be required.
      $form['database']['settings'][$key]['database']['#required'] = FALSE;
      $form['database']['settings'][$key]['username']['#required'] = FALSE;
      $form['database']['settings'][$key]['#prefix'] = '<h2 class="js-hide">' . $this->t('@driver_name settings', ['@driver_name' => $driver->name()]) . '</h2>';