cakephp / elastic-search

Elastic search datasource for CakePHP
Other
88 stars 53 forks source link

Fix QueryBuilder with numerically indexed arrays #223

Closed cschomburg-hero closed 4 years ago

cschomburg-hero commented 4 years ago

Queries with numerically indexed conditions currently fail in 3.0 due to strict typing (see attached test).

TypeError: strtolower() expects parameter 1 to be string, int given
/www-root/vendor/cakephp/elastic-search/src/QueryBuilder.php:683

This breaks use cases where we want to directly use QueryExpression classes without operators and prevents us from upgrading to Cake 4. Simply moving the strtolower to after handling the numeric case fixes the issue.

othercorey commented 4 years ago

@markstory is this something we want?