I recently came across an interesting issue in SitecoreAI Page Builder where Insert Options were not behaving as expected.
The problem was quite simple to reproduce from the editor's point of view, but the underlying behavior was confusing.
The Problem
We had Page Branches configured as insert options for a page. When opening the page in Page Builder and checking the available insert options, the same Page Branch templates were appearing multiple times.
In other words, instead of seeing something like:
- Branch Template A
- Branch Template B
- Branch Template C
the Page Builder insert menu could show the same branch template more than once.
This was particularly confusing because the configuration itself did not appear to contain duplicate entries.
Initial Investigation
One of the first things I wanted to establish was whether this was simply a Page Builder UI issue or whether the duplication was already present in the data returned by Sitecore.
Sitecore's Pages API provides an endpoint for retrieving the insert options for a page:
GET /api/v1/pages/{pageId}/insertoptions
Checking the effective insert options is useful because it helps distinguish between two possible scenarios:
- The API is already returning duplicate insert options.
- The API returns the correct options but Page Builder displays them multiple times.
There are also a few things worth checking during troubleshooting:
- Page-level insert options
- Template-level insert options
- Insert option relationships such as Parent of and Child of
- Page Branches rules
- Any custom insert option rules or pipeline processors
Another interesting point is that insert options operate at the site collection level. Therefore, when templates are shared across multiple sites in the same site collection, configuration from different site contexts can also become relevant.
Page Branches
The issue becomes particularly interesting when SXA Page Branches are involved.
Page Branches can be added to insert options using the rule:
Add the specified Page Branch to insert options
During the investigation, Sitecore Support also pointed out that Page Branches can produce problems when their rule configuration is inconsistent. For example, a Page Branches folder item can have its rules cleared while the underlying Rule field still contains a value such as:
<ruleset />
That is worth checking if you see errors related to GetMasters or PageBranches in the Sitecore logs.
But in This Case It Was a Sitecore Bug
After investigation, Sitecore Support was able to reproduce the behavior on a clean SitecoreAI instance.
That was the important part of the investigation.
It meant that the duplicate Page Branches were not simply caused by our particular implementation or configuration.
Sitecore confirmed that the behavior was not expected and registered it as a product bug.
Bug Reference
The Sitecore Support bug reference for this issue is:
PGS-6758
At the time of the support response, Sitecore confirmed that there was no immediate fix or workaround available and that the issue would be considered for a future product release.
What I Would Check If You See This Issue
If you are seeing duplicate Page Branches in the Page Builder Insert Options menu, I would check the following before assuming that the product has a bug:
-
Check the effective insert options.
Use the Pages API and see whether duplicates are already present in the response. -
Check page-level insert options.
Open the page settings and compare the page insert options with the template insert options. -
Try restoring the page insert options.
If page-level options have been customized, restore them to the template-level configuration and test again. -
Check template insert options.
Pay particular attention to shared templates and the site collection scope. -
Check Page Branch rules.
If you are using the Add the specified Page Branch to insert options rule, check the Page Branch configuration and Sitecore logs. -
Check for custom insert option processors.
If you have customizations that manipulate effective insert options, make sure the same branch isn't being added more than once.
Conclusion
This was a good example of why it is important to distinguish between a configuration problem and a product issue when troubleshooting Sitecore.
There are several legitimate ways that effective insert options can be affected, particularly when templates, site collections and Page Branches are involved. However, in this particular case, Sitecore was able to reproduce the duplicate Page Branch behavior on a clean SitecoreAI environment and confirmed it as a product bug.
If you encounter the same behavior, the relevant Sitecore Support reference is PGS-6758.
I will update this post if a future SitecoreAI release provides a fix or a documented workaround.
Comments
Post a Comment