You are here

public function GlobalredirectSettingsForm::submitResetDefaults in Global Redirect 8

Clears the caches.

File

src/Form/GlobalredirectSettingsForm.php, line 151
This is the GlobalRedirect admin include which provides an interface to global redirect to change some of the default settings Contains \Drupal\globalredirect\Form\GlobalredirectSettingsForm.

Class

GlobalredirectSettingsForm
Defines a form to configure module settings.

Namespace

Drupal\globalredirect\Form

Code

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

  // Get config factory
  $settingsDefault = $this
    ->getDefaultSettings();
  $config
    ->set('deslash', $settingsDefault['deslash'])
    ->set('nonclean_to_clean', $settingsDefault['nonclean_to_clean'])
    ->set('access_check', $settingsDefault['access_check'])
    ->set('normalize_aliases', $settingsDefault['normalize_aliases'])
    ->set('canonical', $settingsDefault['canonical'])
    ->set('content_location_header', $settingsDefault['content_location_header'])
    ->set('term_path_handler', $settingsDefault['term_path_handler'])
    ->set('frontpage_redirect', $settingsDefault['frontpage_redirect'])
    ->set('ignore_admin_path', $settingsDefault['ignore_admin_path'])
    ->save();
  parent::submitForm($form, $form_state);
}