Make sure the view is completely valid.
TRUE if the view is valid; an array of error strings if it is not.
public function validate() {
$this
->initDisplay();
$errors = array();
$this->display_errors = NULL;
$current_display = $this->current_display;
foreach ($this->displayHandlers as $id => $display) {
if (!empty($display)) {
if (!empty($display->deleted)) {
continue;
}
$result = $this->displayHandlers[$id]
->validate();
if (!empty($result) && is_array($result)) {
$errors = array_merge($errors, $result);
// Mark this display as having validation errors.
$this->display_errors[$id] = TRUE;
}
}
}
$this
->setDisplay($current_display);
return $errors ? $errors : TRUE;
}