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

Fatal error in LocationService copy/move when content/read has limitations

    XMLWordPrintable

    Details

      Description

      I tried something like this:
      $this->getLocationService()->moveSubtree($myLocation, $newParentLocation);

      Which results in following fatal error

      PHP Catchable fatal error:  Argument 1 passed to eZ\Publish\API\Repository\Values\Content\Query\Criterion\LogicalOperator::__construct() must be of the type array, object given, called in /<project-root>/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Repository/LocationService.php on line 674 and defined in /<project-root>/vendor/ezsystems/ezpublish-kernel/eZ/Publish/API/Repository/Values/Content/Query/Criterion/LogicalOperator.php on line 35
      PHP Stack trace:
      PHP   1. {main}() /<project-root>/ezpublish/console:0
      PHP   2. Symfony\Component\Console\Application->run() /<project-root>/ezpublish/console:30
      PHP   3. eZ\Bundle\EzPublishCoreBundle\Console\Application->doRun() /<project-root>/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:121
      PHP   4. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() /<project-root>/vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/Console/Application.php:41
      PHP   5. Symfony\Component\Console\Application->doRun() /<project-root>/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:96
      PHP   6. Symfony\Component\Console\Application->doRunCommand() /<project-root>/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:191
      PHP   7. Symfony\Component\Console\Command\Command->run() /<project-root>/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:900
      ...
      PHP  11. eZ\Publish\Core\Repository\LocationService->moveSubtree() /<project-root>/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/SignalSlot/LocationService.php:301
      PHP  12. eZ\Publish\API\Repository\Values\Content\Query\Criterion\LogicalOperator->__construct() /<project-root>/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Repository/LocationService.php:674
      

      The problem is the CriterionLogicalAnd in this line of code:

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

      the two sub-criteria should be wrapped in an array to work...

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              kuborgh-fdyckhoff Franziska Dyckhoff
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: