You are here

public function RssFields::validate in Views RSS 8.3

Same name in this branch
  1. 8.3 src/Plugin/views/style/RssFields.php \Drupal\views_rss\Plugin\views\style\RssFields::validate()
  2. 8.3 src/Plugin/views/row/RssFields.php \Drupal\views_rss\Plugin\views\row\RssFields::validate()
Same name and namespace in other branches
  1. 8.2 src/Plugin/views/style/RssFields.php \Drupal\views_rss\Plugin\views\style\RssFields::validate()

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 StylePluginBase::validate

File

src/Plugin/views/style/RssFields.php, line 47
Definition of Drupal\views\Plugin\views\style\Rss.

Class

RssFields
Default style plugin to render an RSS feed from fields.

Namespace

Drupal\views_rss\Plugin\views\style

Code

public function validate() {
  $errors = parent::validate();
  $plugin = $this->displayHandler
    ->getPlugin('row');
  if ($plugin
    ->getPluginId() !== 'views_rss_fields') {
    $errors[] = $this
      ->t('Style %style requires an <em>RSS Feed - Fields</em> row plugin.', array(
      '%style' => $this->definition['title'],
    ));
  }
  return $errors;
}