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 ]
          Hide
          Bertrand Dunogier added a comment -

          Ping Petar Spanja & André Rømcke. Is it something that would be resolved with the many changes to Search ?

          Show
          Bertrand Dunogier added a comment - Ping Petar Spanja & André Rømcke . Is it something that would be resolved with the many changes to Search ?
          Bertrand Dunogier made changes -
          Component/s Platform/Search/Legacy Search Engine [ 13343 ]
          Hide
          André Rømcke added a comment -

          Don't think so, as that was about how the string is escaped and such.

          Show
          André Rømcke added a comment - Don't think so, as that was about how the string is escaped and such.
          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 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Confirmed Confirmed
          11s 1 eduardo.fernandes@ez.no 29/May/14 12:27 PM

            People

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

              Dates

              • Created:
                Updated: