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

Wrong parameter for Criterion\LogicalAnd for location service

    XMLWordPrintable

Details

    Description

      It seems there is invalid arguments passed through the CriterionLogicalAnd constructor for the copySubtree method of the location service.

      https://github.com/ezsystems/ezpublish-kernel/blob/master/eZ/Publish/Core/Repository/LocationService.php

      line 26:

      use eZ\Publish\API\Repository\Values\Content\Query\Criterion\LogicalAnd as CriterionLogicalAnd;
      

      line 143:

                  $query = new Query(
                      array(
                          'limit' => 0,
                          'filter' => new CriterionLogicalAnd(
                              new CriterionSubtree( $loadedSubtree->pathString ),
                              new CriterionLogicalNot( $contentReadCriterion )
                          )
                      )
                  );
      

      If we check to the LogicalAnd criterion class:
      https://github.com/ezsystems/ezpublish-kernel/blob/master/eZ/Publish/API/Repository/Values/Content/Query/Criterion/LogicalAnd.php

      and the LogicalOperator criterion class:
      https://github.com/ezsystems/ezpublish-kernel/blob/master/eZ/Publish/API/Repository/Values/Content/Query/Criterion/LogicalOperator.php

      We can see that the constructor attemps an array as a first argument.
      In the location service we put two arguments (CriterionSubtree and CriterionLogicalNot).

      The consequence, for some case we get the current error:

      PHP Catchable fatal error: Argument 1 passed to eZ\\Publish\\API\\Repository\\Values\\Content\\Query\\Criterion
      LogicalOperator::__construct() must be an array

      Attachments

        Activity

          People

            Unassigned Unassigned
            aloyant aloyant
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: