You are here

public function UpdateSettingsForm::submitForm in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/update/src/UpdateSettingsForm.php \Drupal\update\UpdateSettingsForm::submitForm()

Form submission handler.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides ConfigFormBase::submitForm

File

core/modules/update/src/UpdateSettingsForm.php, line 143
Contains \Drupal\update\UpdateSettingsForm.

Class

UpdateSettingsForm
Configure update settings for this site.

Namespace

Drupal\update

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->config('update.settings');

  // See if the update_check_disabled setting is being changed, and if so,
  // invalidate all update status data.
  if ($form_state
    ->getValue('update_check_disabled') != $config
    ->get('check.disabled_extensions')) {
    update_storage_clear();
  }
  $config
    ->set('check.disabled_extensions', $form_state
    ->getValue('update_check_disabled'))
    ->set('check.interval_days', $form_state
    ->getValue('update_check_frequency'))
    ->set('notification.emails', $form_state
    ->get('notify_emails'))
    ->set('notification.threshold', $form_state
    ->getValue('update_notification_threshold'))
    ->save();
  parent::submitForm($form, $form_state);
}