Unverified Commit 62e06d8c authored by Lauri Timmanee's avatar Lauri Timmanee
Browse files

Issue #2938803 by David_Rothstein, spitzialist, vsujeetkumar, yepa, harsha012,...

Issue #2938803 by David_Rothstein, spitzialist, vsujeetkumar, yepa, harsha012, ranjith_kumar_k_u, markconroy, ckrina, Rinku Jacob 13, Gauravmahlawat, longwave, Gábor Hojtsy: Remove the warning about the Umami profile on the install screen
parent 08a9dcb2
Loading
Loading
Loading
Loading
−29
Changes for core/lib/Drupal/Core/Installer/Form/SelectProfileForm.php: 0 added lines, 29 removed lines.
Original line number Diff line number Diff line
@@ -81,11 +81,6 @@ public function buildForm(array $form, FormStateInterface $form_state, $install_
    ];
    foreach (array_keys($names) as $profile_name) {
      $form['profile'][$profile_name]['#description'] = isset($profiles[$profile_name]['description']) ? $this->t($profiles[$profile_name]['description']) : '';
      // @todo Remove hardcoding of 'demo_umami' profile for a generic warning
      // system in https://www.drupal.org/project/drupal/issues/2822414.
      if ($profile_name === 'demo_umami') {
        $this->addUmamiWarning($form);
      }
    }

    $config_sync_directory = Settings::get('config_sync_directory');
@@ -145,28 +140,4 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
    $install_state['parameters']['profile'] = $profile;
  }

  /**
   * Show profile warning if 'demo_umami' profile is selected.
   */
  protected function addUmamiWarning(array &$form) {
    // Warning to show when this profile is selected.
    $description = $form['profile']['demo_umami']['#description'];
    // Re-defines radio #description to show warning when selected.
    $form['profile']['demo_umami']['#description'] = [
      'warning' => [
        '#type' => 'item',
        '#markup' => $this->t('This profile is intended for demonstration purposes only.'),
        '#wrapper_attributes' => [
          'class' => ['messages', 'messages--warning'],
        ],
        '#states' => [
          'visible' => [
            ':input[name="profile"]' => ['value' => 'demo_umami'],
          ],
        ],
      ],
      'description' => ['#markup' => $description],
    ];
  }

}