summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJennifer Hodgdon2013-06-26 20:31:31 (GMT)
committerJennifer Hodgdon2013-06-26 20:31:31 (GMT)
commit3179dd42b8405aa743638071a743abd4a8555726 (patch)
treeecddd1e75576656efa801db10f085279d03a20aa
parentbe96e9dc1ce12818378100f7e856a2a441576083 (diff)
Issue #1962704 by Eli-T, dawehner: Document hook_views_analyze()
-rw-r--r--core/modules/views/views.api.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/core/modules/views/views.api.php b/core/modules/views/views.api.php
index 6b4245b..3001caa 100644
--- a/core/modules/views/views.api.php
+++ b/core/modules/views/views.api.php
@@ -98,6 +98,26 @@
*/
/**
+ * 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.
*
* The data described with this hook is fetched and retrieved by