summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Wehner2011-02-26 21:37:31 (GMT)
committerDaniel Wehner2011-02-26 21:37:31 (GMT)
commit0c912b0c36c1f6b96cae95f69e2e4a16403354a0 (patch)
treedb7db093acded7747669f905a273375adc1731a0
parent5a46b6955eb06caa54443be14f5a2f263a5c29e7 (diff)
Issue #1046170 (follow up) by agentrickard: Provide a better documentation for the problem.
-rw-r--r--CHANGELOG.txt1
-rw-r--r--plugins/views_plugin_query_default.inc7
2 files changed, 6 insertions, 2 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 1208861..c145f63 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -81,6 +81,7 @@ Fix fieldsets in field handler.
#1069100 by paranojik: remove legacy code from views_plugin_row_comment_view:pre_render().
#741234 by voxpelli: Arguments should check for NULL along with empty string to find empty values.
#1046170 by agentrickard, blackice2999, dereine: Execute preExecute before generate the countQuery to fix pagers with node_access.
+#1046170 (follow up) by agentrickard: Provide a better documentation for the problem.
Views 3.x-7.x-alpha1 (05-Jan-2011)
==================================
diff --git a/plugins/views_plugin_query_default.inc b/plugins/views_plugin_query_default.inc
index b31de3d..f670180 100644
--- a/plugins/views_plugin_query_default.inc
+++ b/plugins/views_plugin_query_default.inc
@@ -1274,12 +1274,15 @@ class views_plugin_query_default extends views_plugin_query {
if ($query) {
$additional_arguments = module_invoke_all('views_query_substitutions', $view);
- // Count queries must be tagged to pre_execute; if not, then
- // hook_query_node_access_alter() may munge the count by
+ // Count queries must be run through the preExecute() method.
+ // If not, then hook_query_node_access_alter() may munge the count by
// adding a distinct against an empty query string
// (e.g. COUNT DISTINCT(1) ...) and no pager will return.
+ // See pager.inc > PagerDefault::execute()
+ // http://api.drupal.org/api/drupal/includes--pager.inc/function/PagerDefault::execute/7
// See http://drupal.org/node/1046170.
$count_query->preExecute();
+
// Build the count query.
$count_query = $count_query->countQuery();