Commit ccd1f0b2 authored by catch's avatar catch

Issue #2591147 by Chi: Filter criteria for views, option "Content is updated"...

Issue #2591147 by Chi: Filter criteria for views, option "Content is updated" - causes a SQL syntax error
parent 2ea32d6c
......@@ -81,8 +81,7 @@ public function query() {
$clause = '';
$clause2 = '';
if (\Drupal::moduleHandler()->moduleExists('comment')) {
$ces = $this->query->ensureTable('comment_entity_statistics', $this->relationship);
if ($ces = $this->query->ensureTable('comment_entity_statistics', $this->relationship)) {
$clause = ("OR $ces.last_comment_timestamp > (***CURRENT_TIME*** - $limit)");
$clause2 = "OR $field < $ces.last_comment_timestamp";
}
......
......@@ -80,5 +80,14 @@ public function testHandlers() {
$this->executeView($view);
$this->assertEqual(count($view->result), 1);
$this->assertIdenticalResultset($view, array(array('nid' => $nodes[0]->id())), $column_map);
// Install Comment module and make sure that content types without comment
// field will not break the view.
// See \Drupal\history\Plugin\views\filter\HistoryUserTimestamp::query()
\Drupal::service('module_installer')->install(['comment']);
$view = Views::getView('test_history');
$view->setDisplay('page_2');
$this->executeView($view);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment