You are here

public function FullCalendar::validate in FullCalendar 8

Same name and namespace in other branches
  1. 8.5 src/Plugin/views/style/FullCalendar.php \Drupal\fullcalendar\Plugin\views\style\FullCalendar::validate()
  2. 8.2 src/Plugin/views/style/FullCalendar.php \Drupal\fullcalendar\Plugin\views\style\FullCalendar::validate()
  3. 8.3 src/Plugin/views/style/FullCalendar.php \Drupal\fullcalendar\Plugin\views\style\FullCalendar::validate()
  4. 8.4 src/Plugin/views/style/FullCalendar.php \Drupal\fullcalendar\Plugin\views\style\FullCalendar::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/FullCalendar.php, line 256

Class

FullCalendar
Plugin annotation @ViewsStyle( id = "fullcalendar", title = @Translation("FullCalendar"), help = @Translation("Displays items on a calendar."), theme = "fullcalendar", theme_file = "fullcalendar.theme.inc", display_types = {"normal"} )

Namespace

Drupal\fullcalendar\Plugin\views\style

Code

public function validate() {
  if ($this->displayHandler->display['display_plugin'] != 'default' && !$this
    ->parseFields()) {
    $this->messenger
      ->addWarning($this
      ->t('Display "@display" requires at least one date field.', [
      '@display' => $this->displayHandler->display['display_title'],
    ]), 'error');
  }
  return parent::validate();
}