You are here

public function SimpleSitemapDisplayExtender::validateOptionsForm in Simple XML sitemap (Views integration) 8

Validate the options form.

Overrides DisplayExtenderPluginBase::validateOptionsForm

File

src/Plugin/views/display_extender/SimpleSitemapDisplayExtender.php, line 180
Contains Simple XML Sitemap display extender.

Class

SimpleSitemapDisplayExtender
Simple XML Sitemap display extender plugin.

Namespace

Drupal\simple_sitemap_views\Plugin\views\display_extender

Code

public function validateOptionsForm(&$form, FormStateInterface $form_state) {
  if ($this
    ->hasSitemapSettings() && $form_state
    ->get('section') == 'simple_sitemap') {

    // Validate indexed arguments.
    $arguments = $form_state
      ->getValue('arguments', []);
    $errors = $this
      ->validateIndexedArguments($arguments);
    foreach ($errors as $message) {
      $form_state
        ->setError($form['arguments']['arguments'], $message);
    }
  }
}