Details
-
Bug
-
Resolution: Fixed
-
High
-
5.1, 5.2, 5.3.3, 2014.11, 5.4.0-beta1
-
None
-
eZ5.2
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
- is duplicated by
-
EZP-22407 Wrong parameter for Criterion\LogicalAnd for location service
- Closed