Details
-
Bug
-
Resolution: Fixed
-
High
-
5.2, 2013.09, 5.3, 2014.11, 5.4.0
-
None
Description
When publishing content via repository sudo(), a RuntimeException "Recursive sudo use detected, abort abort!" is thrown.
Sample code:
$repo->sudo( function() use ( $repo, $draft ) { $repo->getContentService()->publishVersion( $draft->versionInfo ); } );
The issue is verifiable when there is a content.tree_root.location_id setting specified.
What happens is the following sequence :
- a LegacyPublishVersionSlot initialises an ezpKernelHandler instance
- a LegacyEvents::PRE_BUILD_LEGACY_KERNEL event is dispatched
- this event is received by eZ\Bundle\EzPublishLegacyBundle\LegacyMapper\Configuration which loads its multi site settings
- configuration mapper asks UrlAliasGenerator for root locations's path prefix
- UrlAliasGenerator sudo loads the location
- Abort Abort !
What's the policy with repository sudo ?