Broken “Select a rendering dialog” after the 10.1.3-PRE hotfix with SXA

As many of you should and have noticed, a recent security issue was found in Sitecore which meant that that issue had to be patched. Instead of supplying us with only an update for the security issue, a cumulative hotfix (or a pre-release) had been issued.

This update contained a lot of functional fixes, however for us it also broke the “Select a rendering dialog”. Where you would normally get a list of components that you could insert in a certain placeholder, the dialog now only showed a tree as follows:

The issue

In Sitecore.ExperienceEditor.config, there used to be the following processor in the getPlaceHolderRenderings pipeline:

      <getPlaceholderRenderings>
        <processor type="Sitecore.Pipelines.GetPlaceholderRenderings.GetAllowedRenderings, Sitecore.Kernel" />
      </getPlaceholderRenderings>

However, after rolling out the new version of Sitecore, this processor has been changed to:

      <getPlaceholderRenderings>
        <processor type="Sitecore.ExperienceEditor.Pipelines.GetPlaceholderRenderings.GetAllowedRenderings, Sitecore.ExperienceEditor" patch:instead="processor[@type='Sitecore.Pipelines.GetPlaceholderRenderings.GetAllowedRenderings, Sitecore.Kernel']" />
      </getPlaceholderRenderings>

Seems fine right, however there might be configs that depend on the original processor to make sure they can be patched properly, which is the case with SXA. When using SXA (10.1) there are a few config files that require the original processors for configs to work, and otherwise you’re missing the processors from SXA, resulting in the incorrect dialog.

The fix

There are two ways to fix the issue:

1. Update to the latest SXA cumulative update

You can update to the latest SXA cumulative update, that includes fixes for the problem above as many other fixes, there is a breaking change however in this update:

Hotfix  Bug     Bug Description
487612	484936	Scriban dynamic placeholders are generated with incorrect ID when 2 or more placeholders are added

In the old scenario, when you’d have two dynamic placeholders in Scriban, you’d have the following placeholder keys:

/main/article-placeholder-1-1
/main/video-placeholder-1-1

In the new scenario, you’d have the following placeholder keys:

/main/article-placeholder-1-1
/main/video-placeholder-1-2

As you can see, the placeholder name of the second (all but the first) placeholder is altered, causing renderings to disappear from your site. I’m not aware of an automatic solution for this, so it looks like you’d need to manually review all your Scriban templates, and then if necessary fix the renderings.

2. Add a custom configuration file

As always, we can fix things ourselves, and this time by applying the following config patch:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
    <sitecore>
        <pipelines>
            <getPlaceholderRenderings>
                <processor
                    patch:after="*[@type='Sitecore.ExperienceEditor.Pipelines.GetPlaceholderRenderings.GetAllowedRenderings, Sitecore.ExperienceEditor']"
                    type="Sitecore.XA.Feature.Composites.Pipelines.GetPlaceholderRenderings.FilterRenderings, Sitecore.XA.Feature.Composites"
                    resolve="true" />
                <processor
                    patch:before="*[@type='Sitecore.ExperienceEditor.Pipelines.GetPlaceholderRenderings.GetAllowedRenderings, Sitecore.ExperienceEditor']"
                    type="Sitecore.XA.Foundation.DynamicPlaceholders.Pipelines.GetPlaceholderRenderings.ReplaceWildcardPlaceholderKey, Sitecore.XA.Foundation.DynamicPlaceholders" />
                <processor
                    patch:instead="*[@type='Sitecore.ExperienceEditor.Pipelines.GetPlaceholderRenderings.GetAllowedRenderings, Sitecore.ExperienceEditor']"
                    type="Sitecore.XA.Foundation.PlaceholderSettings.Pipelines.GetPlaceholderRenderings.GetAllowedRenderings, Sitecore.XA.Foundation.PlaceholderSettings"
                    resolve="true" />
                <processor
                    patch:after="*[@type='Sitecore.XA.Foundation.PlaceholderSettings.Pipelines.GetPlaceholderRenderings.GetAllowedRenderings, Sitecore.XA.Foundation.PlaceholderSettings']"
                    type="Sitecore.XA.Foundation.Presentation.Pipelines.GetPlaceholderRenderings.GetModuleRenderings, Sitecore.XA.Foundation.Presentation"
                    resolve="true" />
                <processor
                    patch:after="*[@type='Sitecore.XA.Foundation.PlaceholderSettings.Pipelines.GetPlaceholderRenderings.GetAllowedRenderings, Sitecore.XA.Foundation.PlaceholderSettings']"
                    type="Sitecore.XA.Foundation.Presentation.Pipelines.GetPlaceholderRenderings.FilterRenderings, Sitecore.XA.Foundation.Presentation"
                    resolve="true" />
                <processor
                    patch:after="*[@type='Sitecore.XA.Foundation.Presentation.Pipelines.GetPlaceholderRenderings.GetModuleRenderings, Sitecore.XA.Foundation.Presentation']"
                    type="Sitecore.XA.Feature.Forms.Pipelines.GetPlaceholderRenderings.FilterSitecoreFormsRenderings, Sitecore.XA.Feature.Forms"
                    resolve="true" />
            </getPlaceholderRenderings>
        </pipelines>
    </sitecore>
</configuration>
  

Leave a Reply

Your email address will not be published. Required fields are marked *