Skip to content
Snippets Groups Projects

Issue #2734445: Postgres entity queries doesn't treat multiple IN conditions correctly

1 file
+ 3
4
Compare changes
  • Side-by-side
  • Inline
@@ -18,14 +18,13 @@ public static function translateCondition(&$condition, SelectInterface $sql_quer
$condition['where'] = 'LOWER(' . $sql_query->escapeField($condition['real_field']) . ') ' . $condition['operator'] . ' (';
$condition['where_args'] = [];
$n = 1;
// Only use the array values in case an associative array is passed as an
// argument following similar pattern in
// \Drupal\Core\Database\Connection::expandArguments().
foreach ($condition['value'] as $value) {
$condition['where'] .= 'LOWER(:value' . $n . '),';
$condition['where_args'][':value' . $n] = $value;
$n++;
$id = md5($value);
$condition['where'] .= 'LOWER(:value' . $id . '),';
$condition['where_args'][':value' . $id] = $value;
}
$condition['where'] = trim($condition['where'], ',');
$condition['where'] .= ')';
Loading