[TASK] Move DB functionality pages.storage_pid to compatibility6 12/37912/7
authorBenjamin Mack <benni@typo3.org>
Tue, 17 Mar 2015 14:51:10 +0000 (15:51 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Tue, 14 Jul 2015 19:59:24 +0000 (21:59 +0200)
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>
typo3/sysext/backend/Classes/Utility/BackendUtility.php
typo3/sysext/backend/Classes/View/PageLayoutView.php
typo3/sysext/compatibility6/Configuration/TCA/Overrides/pages.php [new file with mode: 0644]
typo3/sysext/compatibility6/ext_tables.sql
typo3/sysext/core/Classes/Utility/RootlineUtility.php
typo3/sysext/core/Configuration/TCA/pages.php
typo3/sysext/core/Documentation/Changelog/master/Deprecation-65790-PagesStoragePidDeprecated.rst [new file with mode: 0644]
typo3/sysext/core/ext_tables.sql
typo3/sysext/felogin/Classes/Controller/FrontendLoginController.php
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

index 7473e8e..9378519 100644 (file)
@@ -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'],
index 8a146ae..930eb16 100644 (file)
@@ -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 (file)
index 0000000..8ea7a25
--- /dev/null
@@ -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'
+);
index 3b87c4f..3f46fc7 100644 (file)
@@ -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
+);
index 3fd7d3e..f92e6a8 100644 (file)
@@ -86,7 +86,6 @@ class RootlineUtility {
                'extendToSubpages',
                'doktype',
                'TSconfig',
-               'storage_pid',
                'is_siteroot',
                'mount_pid',
                'mount_pid_ol',
index 36e8628..694acd3 100644 (file)
@@ -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 (file)
index 0000000..727dcb1
--- /dev/null
@@ -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.
index 368b79d..f48c6a6 100644 (file)
@@ -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,
index a404c95..3fc103c 100644 (file)
@@ -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'];
                }
index afb0587..3b62109 100644 (file)
@@ -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();