Sitecore EditFrame buttons disappear

We recently had an odd scenario where Sitecore EditFrame buttons would seemingly disappear randomly. Our edit frame made use of a mixture of Field Editor Buttons (‘/sitecore/templates/System/WebEdit/Field Editor Button’) and Edit Frame Small Buttons (‘/sitecore/templates/System/WebEdit/Edit Frame Small Button’).

We never had problems with the field editor buttons just the edit frame small buttons. On these buttons the clicks are bound to Sitecore commands. Behind the scenes these commands evaluate their querystate to check if they should be visible, disabled or active:

The buttons had a mixture of commands, some custom and some out the box. Examples of the out the box commands were:

Note, to find the code that runs for these commands, have a look in /App_Config/commands.config and search for the specific command name.

After debugging into our custom commands vs the out the box commands we found things like item:movedown has the following checks:

The check that was catching us out was the if (Command.IsLockedByOther(item)) clause.

I’d never have thought to check an item locks as being the cause of EditFrame buttons not showing!!! The more I think about it I can see why the check is there – things like sort order are stored as fields against an item so if they are locked, you shouldn’t be able to edit them. From a UI perspective, it appears edit frame buttons don’t distinguish between CommandState.Disabled and CommandState.Hidden.

Leave a Reply

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