From 0aa3123dce5224c1358ee2a60d9c0ea50f422e5a Mon Sep 17 00:00:00 2001
From: Benni Mack <benni@typo3.org>
Date: Wed, 18 Oct 2017 20:41:21 +0200
Subject: [PATCH] [!!!][TASK] Remove "content_doktypes"

The global option "content_doktypes" is
1. outdated (still contains doktypes 2 which was removed in 4.x)
2. only in use for Workspace Preview Links and Frontend Editing to query page trees

However, the idea was to disallow content editing (QuickEdit) and skip
search of other doktypes for simple DB search (removed in TYPO3 v7)

This is not the case anymore and nowadays a hidden feature which is only
10% implemented, and just another tedious option bloating the system.

The option has been removed and also cleaned via SilentConfigurationUpgradeService.

Resolves: #82803
Releases: master
Change-Id: I4ca868f721142d2ac9f1de0c1a7bccc33086989b
Reviewed-on: https://review.typo3.org/54438
Reviewed-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Tested-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
---
 .../FrontendBackendUserAuthentication.php     |  7 ----
 .../Configuration/DefaultConfiguration.php    |  1 -
 .../DefaultConfigurationDescription.yaml      |  3 --
 ...igurationOptionContent_doktypesRemoved.rst | 35 +++++++++++++++++++
 .../SilentConfigurationUpgradeService.php     |  2 ++
 .../Classes/Service/WorkspaceService.php      |  5 +--
 6 files changed, 38 insertions(+), 15 deletions(-)
 create mode 100644 typo3/sysext/core/Documentation/Changelog/master/Breaking-82803-GlobalConfigurationOptionContent_doktypesRemoved.rst

diff --git a/typo3/sysext/backend/Classes/FrontendBackendUserAuthentication.php b/typo3/sysext/backend/Classes/FrontendBackendUserAuthentication.php
index cee31099c751..a89916cc659c 100644
--- a/typo3/sysext/backend/Classes/FrontendBackendUserAuthentication.php
+++ b/typo3/sysext/backend/Classes/FrontendBackendUserAuthentication.php
@@ -260,13 +260,6 @@ class FrontendBackendUserAuthentication extends BackendUserAuthentication
                 ->from('pages')
                 ->where(
                     $queryBuilder->expr()->eq('pid', $queryBuilder->createNamedParameter($id, \PDO::PARAM_INT)),
-                    $queryBuilder->expr()->in(
-                        'doktype',
-                        $queryBuilder->createNamedParameter(
-                            $GLOBALS['TYPO3_CONF_VARS']['FE']['content_doktypes'],
-                            \PDO::PARAM_INT
-                        )
-                    ),
                     QueryHelper::stripLogicalOperatorPrefix($perms_clause)
                 )
                 ->execute();
diff --git a/typo3/sysext/core/Configuration/DefaultConfiguration.php b/typo3/sysext/core/Configuration/DefaultConfiguration.php
index 526a7059b8a2..b9705f08aa9b 100644
--- a/typo3/sysext/core/Configuration/DefaultConfiguration.php
+++ b/typo3/sysext/core/Configuration/DefaultConfiguration.php
@@ -1025,7 +1025,6 @@ return [
             // array('IPmaskList_1','fe_group uid'), array('IPmaskList_2','fe_group uid')
         ],
         'get_url_id_token' => '#get_URL_ID_TOK#',
-        'content_doktypes' => '1,2,5,7',
         'enable_mount_pids' => true,
         'hidePagesIfNotTranslatedByDefault' => false,
         'eID_include' => [], // Array of key/value pairs where key is "tx_[ext]_[optional suffix]" and value is relative filename of class to include. Key is used as "?eID=" for \TYPO3\CMS\Frontend\Http\RequestHandlerRequestHandler to include the code file which renders the page from that point. (Useful for functionality that requires a low initialization footprint, eg. frontend ajax applications)
diff --git a/typo3/sysext/core/Configuration/DefaultConfigurationDescription.yaml b/typo3/sysext/core/Configuration/DefaultConfigurationDescription.yaml
index be6523c67fe6..1c4b6d180e5c 100644
--- a/typo3/sysext/core/Configuration/DefaultConfigurationDescription.yaml
+++ b/typo3/sysext/core/Configuration/DefaultConfigurationDescription.yaml
@@ -415,9 +415,6 @@ FE:
         get_url_id_token:
             type: text
             description: 'This is the token, which is substituted in the output code in order to keep a GET-based session going. Normally the GET-session-id is 5 chars (''&amp;ftu='') + hash_length (norm. 10)'
-        content_doktypes:
-            type: list
-            description: 'List of pages.doktype values which can contain content (so shortcut pages and external url pages are excluded, but all pages below doktype 199 should be included. doktype=6 is not either (backend users only...).'
         enable_mount_pids:
             type: bool
             description: 'If enabled, the mount_pid feature allowing ''symlinks'' in the page tree (for frontend operation) is allowed.'
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-82803-GlobalConfigurationOptionContent_doktypesRemoved.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-82803-GlobalConfigurationOptionContent_doktypesRemoved.rst
new file mode 100644
index 000000000000..64d98e7d40f3
--- /dev/null
+++ b/typo3/sysext/core/Documentation/Changelog/master/Breaking-82803-GlobalConfigurationOptionContent_doktypesRemoved.rst
@@ -0,0 +1,35 @@
+.. include:: ../../Includes.txt
+
+=========================================================================
+Breaking: #82803 - Global configuration option "content_doktypes" removed
+=========================================================================
+
+See :issue:`82803`
+
+Description
+===========
+
+The configuration option :php:`$TYPO3_CONF_VARS['FE']['content_doktypes']` which declared
+what pages.doktypes values could contain content elements, was removed.
+
+
+Impact
+======
+
+Using this option in custom code will lead to unexpected behaviour.
+
+Changing this option has no effect on TYPO3 Core anymore.
+
+
+Affected Installations
+======================
+
+Installations having this option explicitly set.
+
+
+Migration
+=========
+
+Remove all usages working with this option.
+
+.. index:: LocalConfiguration, NotScanned
\ No newline at end of file
diff --git a/typo3/sysext/install/Classes/Service/SilentConfigurationUpgradeService.php b/typo3/sysext/install/Classes/Service/SilentConfigurationUpgradeService.php
index ad0bbee25bbf..5837868b6cd3 100644
--- a/typo3/sysext/install/Classes/Service/SilentConfigurationUpgradeService.php
+++ b/typo3/sysext/install/Classes/Service/SilentConfigurationUpgradeService.php
@@ -118,6 +118,8 @@ class SilentConfigurationUpgradeService
         'SYS/enableDeprecationLog',
         // #82680
         'GFX/png_truecolor',
+        // #82803
+        'FE/content_doktypes',
     ];
 
     public function __construct(ConfigurationManager $configurationManager = null)
diff --git a/typo3/sysext/workspaces/Classes/Service/WorkspaceService.php b/typo3/sysext/workspaces/Classes/Service/WorkspaceService.php
index abf888bf89a9..3428030d3d0d 100644
--- a/typo3/sysext/workspaces/Classes/Service/WorkspaceService.php
+++ b/typo3/sysext/workspaces/Classes/Service/WorkspaceService.php
@@ -816,10 +816,7 @@ class WorkspaceService implements SingletonInterface
         if ($pageUid > 0 && $workspaceUid > 0) {
             $pageRecord = BackendUtility::getRecord('pages', $pageUid);
             BackendUtility::workspaceOL('pages', $pageRecord, $workspaceUid);
-            if (
-                !GeneralUtility::inList($GLOBALS['TYPO3_CONF_VARS']['FE']['content_doktypes'], $pageRecord['doktype'])
-                || VersionState::cast($pageRecord['t3ver_state'])->equals(VersionState::DELETE_PLACEHOLDER)
-            ) {
+            if (VersionState::cast($pageRecord['t3ver_state'])->equals(VersionState::DELETE_PLACEHOLDER)) {
                 $result = false;
             }
         } else {
-- 
GitLab