You are here

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

Validate that the plugin is correct and can be saved.

Return value

An array of error strings to tell the user what is wrong with this plugin.

Overrides PluginBase::validate

File

src/Plugin/views/display_extender/SimpleSitemapDisplayExtender.php, line 210
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 validate() {
  $errors = parent::validate();

  // Validate the argument options relative to the
  // current state of the view argument handlers.
  if ($this
    ->hasSitemapSettings()) {
    $settings = $this
      ->getSitemapSettings();
    $result = $this
      ->validateIndexedArguments($settings['arguments']);
    $errors = array_merge($errors, $result);
  }
  return $errors;
}