From d88c49fd4123707a5c7b52ae87e39a9f29fa2ebe Mon Sep 17 00:00:00 2001 From: Benjamin Mack <benni@typo3.org> Date: Tue, 17 Mar 2015 15:51:10 +0100 Subject: [PATCH] [TASK] Move DB functionality pages.storage_pid to compatibility6 The TCA definitions are moved to the compatibility6 extension, the DB definition as well. Any reference to the field is marked for deprecation. Resolves: #65790 Releases: master Change-Id: Ic9734ba114c6d23a2216b3aabf2e5658c5a3551b Reviewed-on: http://review.typo3.org/37912 Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch> Tested-by: Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de> Reviewed-by: Georg Ringer <georg.ringer@gmail.com> Tested-by: Georg Ringer <georg.ringer@gmail.com> --- .../Classes/Utility/BackendUtility.php | 1 - .../backend/Classes/View/PageLayoutView.php | 1 - .../Configuration/TCA/Overrides/pages.php | 41 +++++++++++++++++++ typo3/sysext/compatibility6/ext_tables.sql | 7 ++++ .../core/Classes/Utility/RootlineUtility.php | 1 - typo3/sysext/core/Configuration/TCA/pages.php | 25 ----------- ...cation-65790-PagesStoragePidDeprecated.rst | 30 ++++++++++++++ typo3/sysext/core/ext_tables.sql | 1 - .../Controller/FrontendLoginController.php | 1 + .../TypoScriptFrontendController.php | 2 + 10 files changed, 81 insertions(+), 29 deletions(-) create mode 100644 typo3/sysext/compatibility6/Configuration/TCA/Overrides/pages.php create mode 100644 typo3/sysext/core/Documentation/Changelog/master/Deprecation-65790-PagesStoragePidDeprecated.rst diff --git a/typo3/sysext/backend/Classes/Utility/BackendUtility.php b/typo3/sysext/backend/Classes/Utility/BackendUtility.php index 7473e8e7949b..937851912b48 100644 --- a/typo3/sysext/backend/Classes/Utility/BackendUtility.php +++ b/typo3/sysext/backend/Classes/Utility/BackendUtility.php @@ -352,7 +352,6 @@ class BackendUtility { 'doktype' => $val['doktype'], 'TSconfig' => $val['TSconfig'], 'is_siteroot' => $val['is_siteroot'], - 'storage_pid' => $val['storage_pid'], 't3ver_oid' => $val['t3ver_oid'], 't3ver_wsid' => $val['t3ver_wsid'], 't3ver_state' => $val['t3ver_state'], diff --git a/typo3/sysext/backend/Classes/View/PageLayoutView.php b/typo3/sysext/backend/Classes/View/PageLayoutView.php index 8a146ae01d02..930eb162cec8 100644 --- a/typo3/sysext/backend/Classes/View/PageLayoutView.php +++ b/typo3/sysext/backend/Classes/View/PageLayoutView.php @@ -263,7 +263,6 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe 'cache_timeout', 'php_tree_stop', 'TSconfig', - 'storage_pid', 'is_siteroot', 'fe_login_mode' ); diff --git a/typo3/sysext/compatibility6/Configuration/TCA/Overrides/pages.php b/typo3/sysext/compatibility6/Configuration/TCA/Overrides/pages.php new file mode 100644 index 000000000000..8ea7a256d880 --- /dev/null +++ b/typo3/sysext/compatibility6/Configuration/TCA/Overrides/pages.php @@ -0,0 +1,41 @@ +<?php +defined('TYPO3_MODE') or die(); + +// Add "pages.storage_pid" field to TCA column +$additionalColumns = array( + 'storage_pid' => array( + 'exclude' => 1, + 'label' => 'LLL:EXT:lang/locallang_tca.xlf:storage_pid', + 'config' => array( + 'type' => 'group', + 'internal_type' => 'db', + 'allowed' => 'pages', + 'size' => '1', + 'maxitems' => '1', + 'minitems' => '0', + 'show_thumbs' => '1', + 'wizards' => array( + 'suggest' => array( + 'type' => 'suggest' + ) + ) + ) + ) +); +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('pages', $additionalColumns); + +// Add palette +$GLOBALS['TCA']['pages']['palettes']['storage'] = array( + 'showitem' => 'storage_pid;LLL:EXT:cms/locallang_tca.xlf:pages.storage_pid_formlabel', + 'canNotCollapse' => 1 +); + +// Add to "normal" pages, "external URL", "shortcut page" and "storage PID" +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages', + '--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.storage;storage', + \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_DEFAULT . ',' + . \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_LINK . ',' + . \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_SHORTCUT . ',' + . \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_SYSFOLDER, + 'after:media' +); diff --git a/typo3/sysext/compatibility6/ext_tables.sql b/typo3/sysext/compatibility6/ext_tables.sql index 3b87c4ffd12a..3f46fc76fd88 100644 --- a/typo3/sysext/compatibility6/ext_tables.sql +++ b/typo3/sysext/compatibility6/ext_tables.sql @@ -10,3 +10,10 @@ CREATE TABLE tt_content ( longdescURL text, titleText text ); + +# +# Table structure for table 'pages' +# +CREATE TABLE pages ( + storage_pid int(11) DEFAULT '0' NOT NULL +); diff --git a/typo3/sysext/core/Classes/Utility/RootlineUtility.php b/typo3/sysext/core/Classes/Utility/RootlineUtility.php index 3fd7d3e7291c..f92e6a809eb3 100644 --- a/typo3/sysext/core/Classes/Utility/RootlineUtility.php +++ b/typo3/sysext/core/Classes/Utility/RootlineUtility.php @@ -86,7 +86,6 @@ class RootlineUtility { 'extendToSubpages', 'doktype', 'TSconfig', - 'storage_pid', 'is_siteroot', 'mount_pid', 'mount_pid_ol', diff --git a/typo3/sysext/core/Configuration/TCA/pages.php b/typo3/sysext/core/Configuration/TCA/pages.php index 36e86280a37f..694acd3c2acb 100644 --- a/typo3/sysext/core/Configuration/TCA/pages.php +++ b/typo3/sysext/core/Configuration/TCA/pages.php @@ -165,24 +165,6 @@ return array( ) ) ), - 'storage_pid' => array( - 'exclude' => 1, - 'label' => 'LLL:EXT:lang/locallang_tca.xlf:storage_pid', - 'config' => array( - 'type' => 'group', - 'internal_type' => 'db', - 'allowed' => 'pages', - 'size' => '1', - 'maxitems' => '1', - 'minitems' => '0', - 'show_thumbs' => '1', - 'wizards' => array( - 'suggest' => array( - 'type' => 'suggest' - ) - ) - ) - ), 'tx_impexp_origuid' => array('config' => array('type' => 'passthrough')), 't3ver_label' => array( 'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.versionLabel', @@ -844,7 +826,6 @@ return array( --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.module;module, --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.resources, --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.media;media, - --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.storage;storage, --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.config;config, --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.extended, ' @@ -867,7 +848,6 @@ return array( --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.miscellaneous;miscellaneous, --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.resources, --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.media;media, - --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.storage;storage, --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.config;config, --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.extended, ' @@ -891,7 +871,6 @@ return array( --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.miscellaneous;miscellaneous, --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.resources, --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.media;media, - --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.storage;storage, --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.config;config, --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.extended, ' @@ -942,7 +921,6 @@ return array( --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.module;module, --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.resources, --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.media;media, - --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.storage;storage, --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.config;config, --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.extended, ' @@ -1050,9 +1028,6 @@ return array( 'media' => array( 'showitem' => 'media;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.media_formlabel', ), - 'storage' => array( - 'showitem' => 'storage_pid;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.storage_pid_formlabel', - ), 'config' => array( 'showitem' => 'TSconfig;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.TSconfig_formlabel', ) diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-65790-PagesStoragePidDeprecated.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-65790-PagesStoragePidDeprecated.rst new file mode 100644 index 000000000000..727dcb1d81da --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-65790-PagesStoragePidDeprecated.rst @@ -0,0 +1,30 @@ +======================================================== +Deprecation: #65790 - Remove pages.storage_pid and logic +======================================================== + +Description +=========== + +The DB field "pages.storage_pid" and its TCA definition are moved to the compatibility6 extension as the field +and its functionality is discouraged. + +Additionally the method ``getStorageSiterootPids()`` within the PHP class TypoScriptFrontendController is marked +for deprecation. The method is currently only used if the Frontend Login plugin is used without setting +a specific folder where the fe_users records are stored in. + + +Impact +====== + +Any usage of this field in any TypoScript, page or the usage of the method mentioned above in any third-party +extension will only work if the compatibility6 extension is installed. + +The Frontend Login functionality will throw a deprecation warning if the TypoScript option +``plugin.tx_felogin.storagePid`` (via TypoScript directly or the flexform configuraiton within the plugin) is not set. + + +Affected installations +====================== + +All installations making use of ``storage_pid`` within the pages database table as well as installations using +the Frontend Login plugin without having the storagePid option set. diff --git a/typo3/sysext/core/ext_tables.sql b/typo3/sysext/core/ext_tables.sql index 368b79d01d03..f48c6a6fcdbd 100644 --- a/typo3/sysext/core/ext_tables.sql +++ b/typo3/sysext/core/ext_tables.sql @@ -122,7 +122,6 @@ CREATE TABLE pages ( title varchar(255) DEFAULT '' NOT NULL, doktype int(11) unsigned DEFAULT '0' NOT NULL, TSconfig text, - storage_pid int(11) DEFAULT '0' NOT NULL, is_siteroot tinyint(4) DEFAULT '0' NOT NULL, php_tree_stop tinyint(4) DEFAULT '0' NOT NULL, tx_impexp_origuid int(11) DEFAULT '0' NOT NULL, diff --git a/typo3/sysext/felogin/Classes/Controller/FrontendLoginController.php b/typo3/sysext/felogin/Classes/Controller/FrontendLoginController.php index a404c9538a92..3fc103cca2bc 100644 --- a/typo3/sysext/felogin/Classes/Controller/FrontendLoginController.php +++ b/typo3/sysext/felogin/Classes/Controller/FrontendLoginController.php @@ -138,6 +138,7 @@ class FrontendLoginController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin $this->spid = $this->conf['storagePid']; } } else { + GeneralUtility::deprecationLog('Extension "felogin" must have a storagePid set via TypoScript or the plugin configuration.'); $pids = $this->frontendController->getStorageSiterootPids(); $this->spid = $pids['_STORAGE_PID']; } diff --git a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php index afb05878e04e..3b6210916bc7 100644 --- a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php +++ b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php @@ -4127,8 +4127,10 @@ class TypoScriptFrontendController { * Traverses the ->rootLine and returns an array with the first occurrance of storage pid and siteroot pid * * @return array Array with keys '_STORAGE_PID' and '_SITEROOT' set to the first occurrences found. + * @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8. The usage of "storage_pid" is discouraged, the option for "is_siteroot" is handled via the RootlineUtility directly. */ public function getStorageSiterootPids() { + GeneralUtility::logDeprecatedFunction(); $res = array(); if (!is_array($this->rootLine)) { return array(); -- GitLab