Issue #2823910 by daffie, pwolanin, smustgrave, neclimdul, larowlan, dawehner:...
Issue #2823910 by daffie, pwolanin, smustgrave, neclimdul, larowlan, dawehner: DBTNG/EQ condition works inconsistently with arrays
(cherry picked from commit 485604fe)
@@ -106,9 +106,15 @@ public function condition($field, $value = NULL, $operator = '=') {
thrownewInvalidQueryException(sprintf("Query condition '%s %s ()' cannot be empty.",$field,$operator));
}
if(is_array($value)&&in_array($operator,['=','<','>','<=','>=','IS NULL','IS NOT NULL'],TRUE)){
if(count($value)>1){
$value=implode(', ',$value);
thrownewInvalidQueryException(sprintf("Query condition '%s %s %s' must have an array compatible operator.",$field,$operator,$value));
}
else{
$value=$value[0];
@trigger_error('Calling '.__METHOD__.'() without an array compatible operator is deprecated in drupal:10.1.0 and will be required in drupal:11.0.0. See https://www.drupal.org/node/3350985',E_USER_DEPRECATED);
$this->expectDeprecation('Calling Drupal\Core\Database\Query\Condition::condition() without an array compatible operator is deprecated in drupal:10.1.0 and will be required in drupal:11.0.0. See https://www.drupal.org/node/3350985');