diff --git a/core/modules/views/src/Plugin/views/filter/Combine.php b/core/modules/views/src/Plugin/views/filter/Combine.php index 6afbb98..f4a6f73 100644 --- a/core/modules/views/src/Plugin/views/filter/Combine.php +++ b/core/modules/views/src/Plugin/views/filter/Combine.php @@ -3,6 +3,7 @@ namespace Drupal\views\Plugin\views\filter; use Drupal\Core\Form\FormStateInterface; +use Drupal\Core\Database\Database; /** * Filter handler which allows to search on multiple fields. @@ -161,7 +162,7 @@ protected function opContainsWord($expression) { $temp_placeholder = $placeholder . '_' . $match_key; // Clean up the user input and remove the sentence delimiters. $word = trim($match[2], ',?!();:-"'); - $this->query->addWhereExpression($group, "$expression LIKE $temp_placeholder", array($temp_placeholder => '%' . db_like($word) . '%')); + $this->query->addWhereExpression($group, $expression . ' ' . Database::getConnection()->mapConditionOperator('LIKE') ?: 'LIKE' . ' ' . $temp_placeholder, array($temp_placeholder => '%' . Database::getConnection()->escapeLike($word) . '%')); } } diff --git a/core/modules/views/tests/src/Kernel/Handler/FilterCombineTest.php b/core/modules/views/tests/src/Kernel/Handler/FilterCombineTest.php index 0437377..db318a5 100644 --- a/core/modules/views/tests/src/Kernel/Handler/FilterCombineTest.php +++ b/core/modules/views/tests/src/Kernel/Handler/FilterCombineTest.php @@ -110,7 +110,7 @@ public function testFilterCombineWord() { 'name', 'job', ), - 'value' => 'Singer Ringo', + 'value' => 'singer ringo', ), )); @@ -162,7 +162,7 @@ public function testFilterCombineAllWords() { 'job', 'age', ), - 'value' => '25 "John Singer"', + 'value' => '25 "john singer"', ), ));