Commit 2135a251 authored by catch's avatar catch

Issue #2823963 by vaplas, Andrej Galuf, dawehner: Views StringFilter using...

Issue #2823963 by vaplas, Andrej Galuf, dawehner: Views StringFilter using 'Contains any word' or 'Contains all words' breaks query on strings containing only characters that will be trimmed
parent 01f8bd64
......@@ -288,7 +288,7 @@ protected function opContainsWord($field) {
}
}
if (!$where) {
if ($where->count() === 0) {
return;
}
......
......@@ -293,6 +293,42 @@ public function testFilterStringWord() {
],
];
$this->assertIdenticalResultset($view, $resultset, $this->columnMap);
$view->destroy();
$view = Views::getView('test_view');
$view->setDisplay();
// Change the filtering to a sting containing only illegal characters.
$view->displayHandlers->get('default')->overrideOption('filters', [
'description' => [
'id' => 'description',
'table' => 'views_test_data',
'field' => 'description',
'relationship' => 'none',
'operator' => 'allwords',
'value' => ':-)',
],
]);
$this->executeView($view);
$resultset = [
[
'name' => 'Ringo',
],
[
'name' => 'John',
],
[
'name' => 'George',
],
[
'name' => 'Paul',
],
[
'name' => 'Meredith',
],
];
$this->assertIdenticalResultset($view, $resultset);
}
......
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