You are here

public function ConfigurationForm::submitFormSuccess in URLs queuer 8

Form submission handler only called when there are no validation errors.

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 PluginConfigFormBase::submitFormSuccess

File

src/Form/ConfigurationForm.php, line 266

Class

ConfigurationForm
Configuration form for the Url and Path queuer.

Namespace

Drupal\purge_queuer_url\Form

Code

public function submitFormSuccess(array &$form, FormStateInterface $form_state) {
  $this
    ->config('purge_queuer_url.settings')
    ->set('queue_paths', $form_state
    ->getValue('queue_paths'))
    ->set('host_override', $form_state
    ->getValue('host_override'))
    ->set('host', $form_state
    ->getValue('host'))
    ->set('scheme_override', $form_state
    ->getValue('scheme_override'))
    ->set('scheme', $form_state
    ->getValue('scheme'))
    ->set('blacklist', $form_state
    ->getValue('blacklist'))
    ->save();

  // Changes to the blacklist inevitably affect what should be in the registry
  // and what URLs should not be. Because already cached page cache responses
  // aren't checked in UrlRegistrar::determine(), wipe the render cache.
  foreach (Cache::getBins() as $service_id => $cache_backend) {
    if ($service_id === 'render') {
      $cache_backend
        ->deleteAll();
    }
  }
}