#82785Disable/Enable page missing from ContextMenu
Description
When you disable the exclude-configuration for the hidden field of pages, the Disable/Enable entry in the PageTree ContextMenu is missing.
ContextMenu.png
All my editors should have access to the hidden-field of pages. That’s why I added the following configuration in TCA/Overrides/pages.php
unset($GLOBALS['TCA']['pages']['columns']['hidden']['exclude']);
I prefer unsetting exclude fields in TCA over allowing exclude-fields in the user group (if all groups should have access to a field), because I can check in these changes in source-control and the list of exclude-fields in backend user groups gets shorter and clearer.
But when the exclude-setting for hidden is removed, the following check will always return false:
RecordProvider.php#L583
I believe the fix would be to change this if-clause to
if (
$hiddenFieldName !== '' && (!isset($GLOBALS['TCA'][$this->table]['columns'][$hiddenFieldName]['exclude'])
|| $this->backendUser->check('non_exclude_fields', $this->table . ':' . $hiddenFieldName))
) {