Experience Editor Bug with Deleted Items

Experience Editor Bug with Deleted Items

A bug was discovered in Experience Editor where in particular the on-premise Content Management instance made it impossible to use Experience Editor for all editors. XM Cloud will recover from the issue and allow the Experience Editor to continue to be used.

This issue can be reproduced by deleting an item in Content Editor while another tab has the item loaded in Experience Editor. If the editor returns to the tab and reloads it, then it will trigger the issue. This is not a common use case, but it can mistakenly happen if you love to leave your tabs open as an example.

This can be disruptive when there are a large number of editors using the instance and running publishes. The recovery for the on-premise instance is to restart the application.

Reproducing the Issue (XM Cloud)

Take for example the Page Example item being used as the About page for the site:

Opening this page in Experience Editor.

Return to the Content Editor and delete the item:

Reload the tab with the item loaded in Experience Editor.

The Ribbon will result in "Server Error in '/' Application"

Upon inspecting the Network traffic in Developer Tools, the following request results in a 500 status code:

/sitecore/client/Applications/ExperienceEditor/Ribbon.aspx?sc_content=core&ribbonId={570A52B6-6755-461A-8052-5B95EF766F74}&itemId={8B35F2DF-3657-4455-B244-4E75BAE431B5}&deviceId={FE5D7FDF-89C0-4D99-9AA3-B5FBD009C9F3}&database=master&mode=edit&url=/?sc_mode=edit&sc_itemid={6AAA0E75-14E4-46B5-91F3-131F3CD579BB}&sc_lang=en&sc_version=1&sc_site=Second%20Site&lang=en&pageSite=Second Site&version=1

sc_itemid is the Sitecore item that was deleted and itemId is the Home item that Experience Editor was redirected to.

When reviewing the logs, the deleted item is noted as not found.

Further down the logs, there will be exceptions for different parts of the ribbon

In XM Cloud, Experience Editor will be broken as long as a non-existent Item Id is provided. Other items opened in Experience Editor can be completed without issue. The solution is not elegant for editors, but it does not render the Experience Editor useless.

💡
If reproducing with an on-premise installation, be mindful that this will break the ability to use Experience Editor. Use a non-production or sandbox instance to test.

Not So Good for On-Premise

For on-premise instances, the issue breaks Experience Editor for all editors across the instance and the ability to load Experience Editor becomes impossible. The only way to recover from this issue is to recycle the application pool for the Content Management instance.

Future Pre-Release

Sitecore is working on a fix for this issue for on-premise installations and should come out as a pre-release in December. To learn more about pre-releases, refer to https://doc.sitecore.com/xp/en/developers/104/platform-administration-and-architecture/sitecore-xp-pre-releases.html. To reference this issue with Sitecore Support, the following reference number can be used 622162.