function SelectProfileForm::submitForm

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Installer/Form/SelectProfileForm.php \Drupal\Core\Installer\Form\SelectProfileForm::submitForm()
  2. 8.9.x core/lib/Drupal/Core/Installer/Form/SelectProfileForm.php \Drupal\Core\Installer\Form\SelectProfileForm::submitForm()
  3. 10 core/lib/Drupal/Core/Installer/Form/SelectProfileForm.php \Drupal\Core\Installer\Form\SelectProfileForm::submitForm()

Overrides FormInterface::submitForm

File

core/lib/Drupal/Core/Installer/Form/SelectProfileForm.php, line 148

Class

SelectProfileForm
Provides the profile selection form.

Namespace

Drupal\Core\Installer\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
    global $install_state;
    $profile = $form_state->getValue('profile');
    if ($profile === static::CONFIG_INSTALL_PROFILE_KEY) {
        $sync = new FileStorage(Settings::get('config_sync_directory'));
        $profile = $sync->read('core.extension')['profile'] ?? FALSE;
        $install_state['parameters']['existing_config'] = TRUE;
    }
    $install_state['parameters']['profile'] = $profile;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.