Commit d97c58ac authored by catch's avatar catch

Issue #2904663 by tacituseu: Trailing space in field part of where expression...

Issue #2904663 by tacituseu: Trailing space in field part of where expression generated by NumericArgument
parent a7a9a87e
......@@ -105,16 +105,16 @@ public function query($group_by = FALSE) {
}
$placeholder = $this->placeholder();
$null_check = empty($this->options['not']) ? '' : "OR $this->tableAlias.$this->realField IS NULL";
$null_check = empty($this->options['not']) ? '' : " OR $this->tableAlias.$this->realField IS NULL";
if (count($this->value) > 1) {
$operator = empty($this->options['not']) ? 'IN' : 'NOT IN';
$placeholder .= '[]';
$this->query->addWhereExpression(0, "$this->tableAlias.$this->realField $operator($placeholder) $null_check", [$placeholder => $this->value]);
$this->query->addWhereExpression(0, "$this->tableAlias.$this->realField $operator($placeholder)" . $null_check, [$placeholder => $this->value]);
}
else {
$operator = empty($this->options['not']) ? '=' : '!=';
$this->query->addWhereExpression(0, "$this->tableAlias.$this->realField $operator $placeholder $null_check", [$placeholder => $this->argument]);
$this->query->addWhereExpression(0, "$this->tableAlias.$this->realField $operator $placeholder" . $null_check, [$placeholder => $this->argument]);
}
}
......
......@@ -105,7 +105,7 @@ public function testPreviewUI() {
$this->assertText(t('Query execute time'));
$this->assertText(t('View render time'));
$this->assertRaw('<strong>Query</strong>');
$this->assertText("SELECT views_test_data.name AS views_test_data_name\nFROM \n{views_test_data} views_test_data\nWHERE (views_test_data.id = &#039;100&#039; )");
$this->assertText("SELECT views_test_data.name AS views_test_data_name\nFROM \n{views_test_data} views_test_data\nWHERE (views_test_data.id = &#039;100&#039;)");
// Test that the statistics and query are rendered above the preview.
$this->assertTrue(strpos($this->getRawContent(), 'views-query-info') < strpos($this->getRawContent(), 'view-test-preview'), 'Statistics shown above the preview.');
......
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