Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-22957

FullText Criterion not handling properly empty values

    Details

      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

      1. 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 );
        

      2. Execute the command with an empty value for $text

        php ezpublish/console teste:mysearch "" /1/2/12
        

        Issue Links

          Activity

          Eduardo Fernandes (Inactive) created issue -
          Eduardo Fernandes (Inactive) made changes -
          Field Original Value New Value
          Status Open [ 1 ] Confirmed [ 10037 ]
          Eduardo Fernandes (Inactive) made changes -
          Link This issue relates to EZP-22930 [ EZP-22930 ]
          Eduardo Fernandes (Inactive) made changes -
          Link This issue relates to EZP-22930 [ EZP-22930 ]
          Eduardo Fernandes (Inactive) made changes -
          Description Detected while testing EZP-22930.
          If you make a Criterion\FullText search with an empty value and you will get the following error:
          {color:red}
          *[eZ\Publish\Core\Persistence\Database\QueryException]* The expression ' OR ' expected at least 1 argument but none provided.
          {color}

          According to the error trace, the problem seems to come from CriterionHandler\FullText->getWordIdSubquery
          {quote}
          #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), '')
          {quote}

          h3. Steps to reproduce
          # Create a command that performs a search with a Criterion\FullText
          {code}
          $filter = array(
          'filter' => new Criterion\LogicalAnd( array(
          new Criterion\FullText( $text ),
          new Criterion\Subtree( $subtree )
          ) )
          );
            
          $query = new Query( $filter );
          {code}
          # Execute the command with an empty value for $text
          {code}
          php ezpublish/console teste:mysearch "" /1/2/12
          {code}
          Detected while testing EZP-22930.
          If you make a Criterion\FullText search with an empty value and you will get the following error:
          {color:red}
          *[eZ\Publish\Core\Persistence\Database\QueryException]* The expression ' OR ' expected at least 1 argument but none provided.
          {color}

          *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 patch is not in the format /1/2/xxx*

          According to the error trace, the problem seems to come from CriterionHandler\FullText->getWordIdSubquery
          {quote}
          #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), '')
          {quote}

          h3. Steps to reproduce
          # Create a command that performs a search with a Criterion\FullText
          {code}
          $filter = array(
          'filter' => new Criterion\LogicalAnd( array(
          new Criterion\FullText( $text ),
          new Criterion\Subtree( $subtree )
          ) )
          );
            
          $query = new Query( $filter );
          {code}
          # Execute the command with an empty value for $text
          {code}
          php ezpublish/console teste:mysearch "" /1/2/12
          {code}
          Paulo Nunes (Inactive) made changes -
          Link This issue discovered while testing EZP-22930 [ EZP-22930 ]
          Paulo Nunes (Inactive) made changes -
          Link This issue relates to EZP-22930 [ EZP-22930 ]
          Paulo Nunes (Inactive) made changes -
          Affects Version/s 5.3-dev [ 12979 ]
          Affects Version/s 5.3 [ 11282 ]
          Joao Inacio (Inactive) made changes -
          Description Detected while testing EZP-22930.
          If you make a Criterion\FullText search with an empty value and you will get the following error:
          {color:red}
          *[eZ\Publish\Core\Persistence\Database\QueryException]* The expression ' OR ' expected at least 1 argument but none provided.
          {color}

          *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 patch is not in the format /1/2/xxx*

          According to the error trace, the problem seems to come from CriterionHandler\FullText->getWordIdSubquery
          {quote}
          #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), '')
          {quote}

          h3. Steps to reproduce
          # Create a command that performs a search with a Criterion\FullText
          {code}
          $filter = array(
          'filter' => new Criterion\LogicalAnd( array(
          new Criterion\FullText( $text ),
          new Criterion\Subtree( $subtree )
          ) )
          );
            
          $query = new Query( $filter );
          {code}
          # Execute the command with an empty value for $text
          {code}
          php ezpublish/console teste:mysearch "" /1/2/12
          {code}
          Detected while testing EZP-22930.
          If you make a Criterion\FullText search with an empty value and you will get the following error:
          {color:red}
          *[eZ\Publish\Core\Persistence\Database\QueryException]* The expression ' OR ' expected at least 1 argument but none provided.
          {color}

          *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
          {quote}
          #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), '')
          {quote}

          h3. Steps to reproduce
          # Create a command that performs a search with a Criterion\FullText
          {code}
          $filter = array(
          'filter' => new Criterion\LogicalAnd( array(
          new Criterion\FullText( $text ),
          new Criterion\Subtree( $subtree )
          ) )
          );
            
          $query = new Query( $filter );
          {code}
          # Execute the command with an empty value for $text
          {code}
          php ezpublish/console teste:mysearch "" /1/2/12
          {code}
          André Rømcke made changes -
          Workflow eZ Engineering Scrumban Workflow [ 63433 ] EZ* Development Workflow [ 70179 ]
          Bertrand Dunogier made changes -
          Component/s Platform/Search/Legacy Search Engine [ 13343 ]
          André Rømcke made changes -
          Link This issue is duplicated by EZP-23062 [ EZP-23062 ]
          Alex Schuster made changes -
          Workflow EZ* Development Workflow [ 70179 ] EZEE Development Workflow [ 108490 ]
          André Rømcke made changes -
          Link This issue relates to EZP-27416 [ EZP-27416 ]
          André Rømcke made changes -
          Link This issue relates to EZP-23062 [ EZP-23062 ]
          André Rømcke made changes -
          Link This issue relates to EZP-21869 [ EZP-21869 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Eduardo Fernandes (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: