Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #6242 Fixed invalid DQL (alshenetsky)
This PR was merged into the 4.x branch. Discussion ---------- Fixed invalid DQL Fixes #6223 When searching text having only integer fields, an invalid DQL like `SELECT entity FROM App\Entity\Product entity WHERE ` is generated because there are no any `$queryTermConditions`. This PR should fix the issue. Commits ------- 6511215 Fixed invalid DQL
- Loading branch information
Showing
1 changed file
with
1 addition
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,7 +120,7 @@ private function addSearchClause(QueryBuilder $queryBuilder, SearchDto $searchDt | |
$parameterName = sprintf('query_for_ulids_%d', $queryTermIndex); | ||
$queryTermConditions->add(sprintf('%s.%s = :%s', $entityName, $propertyConfig['property_name'], $parameterName)); | ||
$queryBuilder->setParameter($parameterName, $dqlParameters['uuid_query'], 'ulid'); | ||
} elseif ($propertyConfig['is_text']) { | ||
} elseif ($propertyConfig['is_text'] || $propertyConfig['is_integer']) { | ||
$parameterName = sprintf('query_for_text_%d', $queryTermIndex); | ||
$queryTermConditions->add(sprintf('LOWER(%s.%s) LIKE :%s', $entityName, $propertyConfig['property_name'], $parameterName)); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
hellomedia
|
||
$queryBuilder->setParameter($parameterName, $dqlParameters['text_query']); | ||
|
@javiereguiluz In my app, it triggers this postgresql error :
Undefined function: 7 ERROR: function lower(integer) does not exist
.LOWER()
requires a string parameter.