1.20.x update.admin.inc update_settings_submit($form, $form_state)

Form submission handler for update_settings().

Also invalidates the cache of available updates if the "Check for updates of disabled and uninstalled modules, themes, and layouts." setting is being changed. The available updates report needs to refetch available update data after this setting changes or it would show misleading things (e.g., listing the disabled projects on the site with the "No available releases found" warning).

See also

update_settings_validate()

File

modules/update/update.admin.inc, line 159
Admin page callbacks for the Update Manager module.

Code

function update_settings_submit($form, $form_state) {
  $config = config('update.settings');

  // See if the update_check_disabled setting is being changed, and if so,
  // invalidate all cached update status data.
  if ($form_state['values']['update_check_disabled'] != $config->get('update_disabled_extensions')) {
    _update_cache_clear();
  }

  $config
  ->set('update_disabled_extensions', $form_state['values']['update_check_disabled'])
    ->set('update_interval_days', $form_state['values']['update_check_frequency'])
    ->set('update_emails', $form_state['notify_emails'])
    ->set('update_threshold', $form_state['values']['update_notification_threshold'])
    ->save();

  // Save the installer setting.
  config_set('installer.settings', 'core_update', $form_state['values']['core_update']);

  // Display status messages for this form.
  backdrop_set_message(t('The configuration options have been saved.'));
}