diff --git a/engine/Shopware/Bundle/SearchBundleDBAL/ConditionHandler/DynamicConditionParserTrait.php b/engine/Shopware/Bundle/SearchBundleDBAL/ConditionHandler/DynamicConditionParserTrait.php index 1dfcbc33f33..a6061599b37 100644 --- a/engine/Shopware/Bundle/SearchBundleDBAL/ConditionHandler/DynamicConditionParserTrait.php +++ b/engine/Shopware/Bundle/SearchBundleDBAL/ConditionHandler/DynamicConditionParserTrait.php @@ -66,7 +66,11 @@ public function parse(QueryBuilder $query, $table, $tableAlias, $field = null, $ throw new \RuntimeException("Could not retrieve columns from '$table'"); } - if (!array_key_exists($field, $columns)) { + $names = array_map(function (\Doctrine\DBAL\Schema\Column $column) { + return strtolower($column->getName()); + }, $columns); + + if (!array_key_exists(strtolower($field), $names)) { throw new \InvalidArgumentException("Invalid column name specified '$field'", 1); } @@ -85,7 +89,7 @@ public function parse(QueryBuilder $query, $table, $tableAlias, $field = null, $ Condition::OPERATOR_CONTAINS, ]; - //Normalize with strtoupper in case of non-algorithmic comparisons NOT IN, IN, STARTS WITH + // Normalize with strtoupper in case of non-algorithmic comparisons NOT IN, IN, STARTS WITH $operator = strtoupper(trim($operator)); /*