Version 1
[yaffs-website] / web / core / modules / user / user.views_execution.inc
diff --git a/web/core/modules/user/user.views_execution.inc b/web/core/modules/user/user.views_execution.inc
new file mode 100644 (file)
index 0000000..255fbf2
--- /dev/null
@@ -0,0 +1,17 @@
+<?php
+
+/**
+ * @file
+ * Provide views runtime hooks for user.module.
+ */
+
+use Drupal\views\ViewExecutable;
+
+/**
+ * Implements hook_views_query_substitutions().
+ *
+ * Allow replacement of current userid so we can cache these queries.
+ */
+function user_views_query_substitutions(ViewExecutable $view) {
+  return ['***CURRENT_USER***' => \Drupal::currentUser()->id()];
+}