public function ViewExecutable::validate in Views (for Drupal 7) 8.3
Make sure the view is completely valid.
Return value
TRUE if the view is valid; an array of error strings if it is not.
2 calls to ViewExecutable::validate()
- ViewUI::getDisplayTabs in views_ui/
lib/ Drupal/ views_ui/ ViewUI.php - Adds tabs for navigating across Displays when editing a View.
- ViewUI::renderPreview in views_ui/
lib/ Drupal/ views_ui/ ViewUI.php
File
- lib/
Drupal/ views/ ViewExecutable.php, line 1877 - Definition of Drupal\views\ViewExecutable.
Class
- ViewExecutable
- An object to contain all of the data to generate a view, plus the member functions to build the view query, execute the query and render the output.
Namespace
Drupal\viewsCode
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;
}