diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 1208861c04270ec6e74a35dcbf9c956d1223815d..c145f6326665296655c12e141a37ea9028a9b1b9 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 b31de3dfd6c5927e928c096033dd69327b63a3ff..f6701806e2f96c41eaac819e75938fc6419f42f2 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();