1.20.x views_plugin_style.inc views_plugin_style::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 views_plugin::validate

File

modules/views/plugins/views_plugin_style.inc, line 582
Definition of views_plugin_style.

Class

views_plugin_style
Base class to define a style plugin handler.

Code

function validate() {
  $errors = parent::validate();

  if ($this->uses_row_plugin()) {
    $plugin = $this->display->handler->get_plugin('row');
    if (empty($plugin)) {
      $errors[] = t('Style @style requires a row style but the row plugin is invalid.', array('@style' => $this->definition['title']));
    }
    else {
      $result = $plugin->validate();
      if (!empty($result) && is_array($result)) {
        $errors = array_merge($errors, $result);
      }
    }
  }
  return $errors;
}