Issue Bug Closed

#82785Disable/Enable page missing from ContextMenu

Robert Vock 10/17/17, 16:01 updated 10/02/18, 10:55

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))
) {

Reviews 1