Details
-
Bug
-
Resolution: Unresolved
-
High
-
5.3-dev
-
None
Description
Detected while testing EZP-22930.
If you make a Criterion\FullText search with an empty value and you will get the following error:
[eZ\Publish\Core\Persistence\Database\QueryException] The expression ' OR ' expected at least 1 argument but none provided.
It's important to notice that, if empty values are not suposed to be used, there should be an exception in the same way Criterion\Subtree does when the path is not in the format /1/2/xxx
According to the error trace, the problem seems to come from CriterionHandler\FullText->getWordIdSubquery
#0 /var/www/eZ/530/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Doctrine/DoctrineExpression.php(56): eZ\Publish\Core\Persistence\Doctrine\DoctrineExpression->combine(Array, ' OR ')
#1 /var/www/eZ/530/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Search/Common/Gateway/CriterionHandler/FullText.php(186): eZ\Publish\Core\Persistence\Doctrine\DoctrineExpression->lOr(Array)
#2 /var/www/eZ/530/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Search/Common/Gateway/CriterionHandler/FullText.php(218): eZ\Publish\Core\Persistence\Legacy\Content\Search\Common\Gateway\CriterionHandler\FullText->getWordIdSubquery(Object(eZ\Publish\Core\Persistence\Doctrine\SubselectDoctrineQuery), '')
Steps to reproduce
- Create a command that performs a search with a Criterion\FullText
$filter = array( 'filter' => new Criterion\LogicalAnd( array( new Criterion\FullText( $text ), new Criterion\Subtree( $subtree ) ) ) ); $query = new Query( $filter );
- Execute the command with an empty value for $text
php ezpublish/console teste:mysearch "" /1/2/12
Attachments
Issue Links
- discovered while testing
-
EZP-22930 Search: Remove duplicate criterions
- Closed
- is duplicated by
-
EZP-23062 Exception when using Criterion\FullText with empty string
- Confirmed
- relates to
-
EZP-21869 Bug when Criterion\FullText with empty value
- Backlog
-
EZP-27416 Error 500 on search when trying to search space or single quote
- Development Review
-
EZP-22930 Search: Remove duplicate criterions
- Closed
-
EZP-23062 Exception when using Criterion\FullText with empty string
- Confirmed