Skip to content
Snippets Groups Projects

Fix operator code

Files
2
@@ -228,6 +228,9 @@ class EntityQueryBase extends DataProducerPluginBase implements ContainerFactory
$operator = !empty($condition['operator']) ? $condition['operator'] : NULL;
$language = !empty($condition['language']) ? $condition['language'] : NULL;
// Map GraphQL operator to proper ConditionInterface operator.
$operator = static::OPERATOR_MAPPING[$operator] ?? NULL;
// We need at least a value or an operator.
if (empty($operator) && empty($value)) {
throw new UserError(sprintf("Missing value and operator in filter for '%s'.", $field));
@@ -261,11 +264,6 @@ class EntityQueryBase extends DataProducerPluginBase implements ContainerFactory
$operator = is_array($value) ? 'IN' : '=';
}
// Map GraphQL operator to proper ConditionInterface operator.
if (isset(static::OPERATOR_MAPPING[$operator])) {
$operator = static::OPERATOR_MAPPING[$operator];
}
// Add the condition for the current field.
$group->condition($field, $value, $operator, $language);
}
Loading