Details
-
Bug
-
Resolution: Fixed
-
High
-
5.1, 2013.09
-
None
Description
ContentService->loadRelations raises an exception when the user cannot read one of the related content objects, rendering the method useless to list relations on many scenarios
steps to reproduce
- adapt editor role so that content read does not include restricted section
- create an editor user
- create some content and add relation to 2 other objects
- move one of the related objects into restricted section
- run the command below
=> expected result: output should include the related object that the user can read
=> actual result: an exception is raised, no objects are listed$repository = $this->getContainer()->get( 'ezpublish.api.repository' ); $repository->setCurrentUser( $repository->getUserService()->loadUser( <editor-userId> ) ); $locationService = $repository->getLocationService(); $rootLocation = $locationService->loadLocation( $parent ); $contentService = $repository->getContentService(); $content = $contentService->loadContentByContentInfo( $rootLocation->contentInfo ); $versionInfo = $contentService->loadVersionInfoById( $content->id, $content->getVersionInfo()->versionNo ); $allItems = $contentService->loadRelations( $versionInfo ); $output->writeln( print_r( $allItems, true ) );
the same behavior seems to be affecting loadReverseRelations
Attachments
Issue Links
- links to