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

Multisite settings cause recursive sudo when using legacy slot in sudo operation

    XMLWordPrintable

    Details

      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 ?

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            bchoquet Benjamin Choquet
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 15 minutes
                15m