Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / views / src / ManyToOneHelper.php
index d772db1a6315776d85437b32c222d4a9345eb66e..cb2e5754a818f3d48de9f411cf1b8ee3f1141473 100644 (file)
@@ -2,6 +2,7 @@
 
 namespace Drupal\views;
 
+use Drupal\Core\Database\Query\Condition;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\views\Plugin\views\HandlerBase;
 
@@ -268,8 +269,8 @@ class ManyToOneHelper {
       $options['group'] = 0;
     }
 
-    // add_condition determines whether a single expression is enough(FALSE) or the
-    // conditions should be added via an db_or()/db_and() (TRUE).
+    // If $add_condition is set to FALSE, a single expression is enough. If it
+    // is set to TRUE, conditions will be added.
     $add_condition = TRUE;
     if ($operator == 'not') {
       $value = NULL;
@@ -326,7 +327,7 @@ class ManyToOneHelper {
 
     if ($add_condition) {
       $field = $this->handler->realField;
-      $clause = $operator == 'or' ? db_or() : db_and();
+      $clause = $operator == 'or' ? new Condition('OR') : new Condition('AND');
       foreach ($this->handler->tableAliases as $value => $alias) {
         $clause->condition("$alias.$field", $value);
       }