Commit 8900add0 authored by Christian Eßl's avatar Christian Eßl Committed by Daniel Goerz
Browse files

[BUGFIX] Hide the preview button for sysfolders in list/page layout module

In the list view of a sysfolder, users could still see the page preview
button. The list view is now using the same logic as the page module
and the EditDocumentController, that allows for excluding some doktypes
from showing the preview button.

By default, the page types Recycler, Sysfolder and Spacer are excluded.
This behaviour can be overridden by setting the already available
pageTSconfig "TCEMAIN.preview.disableButtonForDokType".

Resolves: #55300
Releases: master, 9.5
Change-Id: Iad7c651e33928b3ababe84c86222291e0bb6c3cc

Tested-by: Benni Mack's avatarBenni Mack <>
Tested-by: Daniel Goerz's avatarDaniel Goerz <>
Tested-by: default avatarTYPO3com <>
Reviewed-by: Benni Mack's avatarBenni Mack <>
Reviewed-by: Daniel Goerz's avatarDaniel Goerz <>
parent b6b62d4b
......@@ -766,7 +766,26 @@ class PageLayoutController
$lang = $this->getLanguageService();
// View page
if (!VersionState::cast($this->pageinfo['t3ver_state'])->equals(VersionState::DELETE_PLACEHOLDER)) {
$pageTsConfig = BackendUtility::getPagesTSconfig($this->id);
// Exclude sysfolders, spacers and recycler by default
$excludeDokTypes = [
// Custom override of values
if (isset($pageTsConfig['TCEMAIN.']['preview.']['disableButtonForDokType'])) {
$excludeDokTypes = GeneralUtility::intExplode(
if (
!in_array((int)$this->pageinfo['doktype'], $excludeDokTypes, true)
&& !VersionState::cast($this->pageinfo['t3ver_state'])->equals(VersionState::DELETE_PLACEHOLDER)
) {
$languageParameter = $this->current_sys_language ? ('&L=' . $this->current_sys_language) : '';
$onClick = BackendUtility::viewOnClick(
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment