function RssFields::validate

Same name in other branches
  1. 9 core/modules/views/src/Plugin/views/row/RssFields.php \Drupal\views\Plugin\views\row\RssFields::validate()
  2. 8.9.x core/modules/views/src/Plugin/views/row/RssFields.php \Drupal\views\Plugin\views\row\RssFields::validate()
  3. 11.x core/modules/views/src/Plugin/views/row/RssFields.php \Drupal\views\Plugin\views\row\RssFields::validate()

Overrides PluginBase::validate

File

core/modules/views/src/Plugin/views/row/RssFields.php, line 109

Class

RssFields
Renders an RSS item based on fields.

Namespace

Drupal\views\Plugin\views\row

Code

public function validate() {
    $errors = parent::validate();
    $required_options = [
        'title_field',
        'link_field',
        'description_field',
        'creator_field',
        'date_field',
    ];
    foreach ($required_options as $required_option) {
        if (empty($this->options[$required_option])) {
            $errors[] = $this->t('Row style plugin requires specifying which views fields to use for RSS item.');
            break;
        }
    }
    // Once more for guid.
    if (empty($this->options['guid_field_options']['guid_field'])) {
        $errors[] = $this->t('Row style plugin requires specifying which views fields to use for RSS item.');
    }
    return $errors;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.