summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.txt1
-rw-r--r--modules/views_comment.inc2
2 files changed, 2 insertions, 1 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 46d90c0..9523bd7 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -7,6 +7,7 @@ Views 4.7.x-dev
Bugs fixed:
o #140431: Taxonomy select boxes were improperly showing descriptions.
o #138510: Multi-select for taxonomy had disappeared.
+ o #117365: Comment: Last Changed Time wasn't ensuring node_comment_statistics is in the query.
Views 4.7.x-1.6-beta3
o Reverting #130196: The original behavior was correct.
diff --git a/modules/views_comment.inc b/modules/views_comment.inc
index 362f821..632c57d 100644
--- a/modules/views_comment.inc
+++ b/modules/views_comment.inc
@@ -178,6 +178,7 @@ function comment_views_tables() {
}
function views_query_handler_field_last_changed($field, $fieldinfo, &$query) {
+ $query->ensure_table('node_comment_statistics');
$query->add_field('GREATEST(node.changed, node_comment_statistics.last_comment_timestamp)', '', $field['tablename'] . '_last_changed');
}
@@ -191,7 +192,6 @@ function views_handler_filter_last_changed($op, $filter, $filterinfo, &$query) {
$query->add_where("%s %s %s + %d", $field, $filter['operator'], $value, $filter['options']);
}
-
function views_handler_sort_last_changed($action, &$query, $sortinfo, $sort) {
$query->ensure_table('node_comment_statistics');
$query->orderby[] = 'GREATEST(node.changed, node_comment_statistics.last_comment_timestamp) ' . $sort['sortorder'];