Skip to content
Snippets Groups Projects
Commit 3179dd42 authored by Jennifer Hodgdon's avatar Jennifer Hodgdon
Browse files

Issue #1962704 by Eli-T, dawehner: Document hook_views_analyze()

parent be96e9dc
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -97,6 +97,26 @@
* Hooks that allow other modules to implement the Views API.
*/
/**
* Analyze a view to provide warnings about its configuration.
*
* @param \Drupal\views\ViewExecutable $view
* The view being executed.
*
* @return array
* Array of warning messages built by Analyzer::formatMessage to be displayed
* to the user following analysis of the view.
*/
function hook_views_analyze(Drupal\views\ViewExecutable $view) {
$messages = array();
if ($view->display_handler->options['pager']['type'] == 'none') {
$messages[] = Drupal\views\Analyzer::formatMessage(t('This view has no pager. This could cause performance issues when the view contains many items.'), 'warning');
}
return $messages;
}
/**
* Describe data tables (or the equivalent) to Views.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment