diff --git a/typo3/sysext/core/Classes/Authentication/GroupResolver.php b/typo3/sysext/core/Classes/Authentication/GroupResolver.php index 5b05bd005541b948729692bb83b6f6ce48d726d4..25eec67923a88538143b1bcb956c9338ecd99973 100644 --- a/typo3/sysext/core/Classes/Authentication/GroupResolver.php +++ b/typo3/sysext/core/Classes/Authentication/GroupResolver.php @@ -27,7 +27,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; * A provider for resolving fe_groups / be_groups, including nested sub groups. * * When fetching subgroups, the current group (parent group) is handed in recursive. - * Duplicates are suppressed: If a sub group is including in multiple parent groups, + * Duplicates are suppressed: If a subgroup is including in multiple parent groups, * it will be resolved only once. * * @internal this is not part of TYPO3 Core API. diff --git a/typo3/sysext/core/Configuration/DefaultConfiguration.php b/typo3/sysext/core/Configuration/DefaultConfiguration.php index d835d61f6126ce5016101921be1f6e912c6a82d1..303a62a40cdc4005e1861111583c429a1dee189f 100644 --- a/typo3/sysext/core/Configuration/DefaultConfiguration.php +++ b/typo3/sysext/core/Configuration/DefaultConfiguration.php @@ -1364,7 +1364,7 @@ return [ 'cookieDomain' => '', 'cookieName' => 'fe_typo_user', 'cookieSameSite' => 'lax', - 'defaultUserTSconfig' => '', + 'defaultUserTSconfig' => '', // @deprecated since v12, remove in v13 together with fe_users & fe_groups TSconfig TCA, add to SilentConfigurationUpgradeService 'defaultTypoScript_constants' => '', 'defaultTypoScript_constants.' => [], // Lines of TS to include after a static template with the uid = the index in the array (Constants) 'defaultTypoScript_setup' => '', diff --git a/typo3/sysext/core/Configuration/DefaultConfigurationDescription.yaml b/typo3/sysext/core/Configuration/DefaultConfigurationDescription.yaml index c8fdb3fb57f9dbbe96aee00bca0af87fb461ee97..21d7c098e29f176277c940c589507f91eebb84dd 100644 --- a/typo3/sysext/core/Configuration/DefaultConfigurationDescription.yaml +++ b/typo3/sysext/core/Configuration/DefaultConfigurationDescription.yaml @@ -476,9 +476,6 @@ FE: 'strict': 'Cookies sent by TYPO3 are only available for the current site, never shared to other third-party packages' 'none': 'Allow cookies set by TYPO3 to be sent to other sites as well, please note - this only works with HTTPS connections' description: 'Indicates that the cookie should send proper information where the cookie can be shared (first-party cookies vs. third-party cookies) in TYPO3 Frontend.' - defaultUserTSconfig: - type: multiline - description: 'Enter lines of default frontend user/group TSconfig.' defaultTypoScript_constants: type: multiline description: 'Enter lines of default TypoScript, constants-field.' diff --git a/typo3/sysext/core/Documentation/Changelog/12.1/Deprecation-99075-Fe_usersAndFe_groupsTSconfig.rst b/typo3/sysext/core/Documentation/Changelog/12.1/Deprecation-99075-Fe_usersAndFe_groupsTSconfig.rst new file mode 100644 index 0000000000000000000000000000000000000000..ba850d414fb97040c814de903ba6ee75d2a3292b --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/12.1/Deprecation-99075-Fe_usersAndFe_groupsTSconfig.rst @@ -0,0 +1,67 @@ +.. include:: /Includes.rst.txt + +.. _deprecation-99075-1668337874: + +===================================================== +Deprecation: #99075 - fe_users and fe_groups TSconfig +===================================================== + +See :issue:`99075` + +Description +=========== + +The two database fields :sql:`fe_users.TSconfig` and :sql:`fe_groups.TSconfig` +have been marked as deprecated in TYPO3 v12 and will be removed in v13 along with +its PHP API. + + +Impact +====== + +Backend users and groups provide these `TSconfig` fields as well, they are the base +of the well-known `UserTsConfig` configuration to specify rendering and behavior of +TYPO3 Backend related details. This is kept. + +Frontend users and groups had these fields as well, they are unused by TYPO3 core +and only a few extensions ever used them. + +The Frontend user and group related database fields, the editing functionality of +these fields in the Backend (:php:`TCA`), and according PHP API will be removed with +TYPO3 v13. In detail: + +* Database field :sql:`fe_users.TSconfig` will be removed from the table definition +* Database field :sql:`fe_groups.TSconfig` will be removed from the table definition +* Rendering and editing setup of field :php:`fe_users.TSconfig` will be removed from :php:`TCA` +* Rendering and editing setup of field :php:`fe_groups.TSconfig` will be removed from :php:`TCA` +* Default configuration value :php:`$GLOBALS['TYPO3_CONF_VARS']['FE']['defaultUserTSconfig']` + will be removed. +* PHP method :php:`\TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication->getUserTSconf()` + will be removed. + + +Affected installations +====================== + +Instances are relatively unlikely to be affected: Only a few extensions ever used these +fields to store configuration for Frontend users, most likely extensions related to +additional authentication mechanisms. + +The extension scanner will find extensions that access :php:`$GLOBALS['TYPO3_CONF_VARS']['FE']['defaultUserTSconfig']` +or call :php:`\TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication->getUserTSconf()` as "weak" matches. + + +Migration +========= + +Extensions should avoid using the fields to store and access configuration in a +TypoScript a-like syntax. Affected extensions should add own fields prefixed with an extension +specific key, or switch to a file based configuration approach if possible. + +To simulate the deprecated logic, extensions may extract the deprecated parsing logic from +class :php:`FrontendUserAuthentication` to an own service, probably my fetch group data +using :php:`\TYPO3\CMS\Core\Authentication\GroupResolver`, to then merge merge group +data of the field with Frontend user specific data and parsing it. + + +.. index:: Database, Frontend, LocalConfiguration, PHP-API, TCA, TSConfig, TypoScript, PartiallyScanned, ext:frontend diff --git a/typo3/sysext/core/Resources/Private/Language/locallang_tca.xlf b/typo3/sysext/core/Resources/Private/Language/locallang_tca.xlf index eb5aa0e0cbad80f1234739a9a35025bb612eb823..c6e4db934892e5a209c470126ea1fe50170ccedd 100644 --- a/typo3/sysext/core/Resources/Private/Language/locallang_tca.xlf +++ b/typo3/sysext/core/Resources/Private/Language/locallang_tca.xlf @@ -48,9 +48,6 @@ <trans-unit id="TSconfig" resname="TSconfig"> <source>TSconfig</source> </trans-unit> - <trans-unit id="TSconfig_title" resname="TSconfig_title"> - <source>TSconfig QuickReference</source> - </trans-unit> <trans-unit id="be_users.username" resname="be_users.username"> <source>Username</source> </trans-unit> diff --git a/typo3/sysext/core/Resources/Private/Language/locallang_wizards.xlf b/typo3/sysext/core/Resources/Private/Language/locallang_wizards.xlf index 80a32d4ad35abaca475877130bbeea82230030e1..6a9e4d96b26e804f1e7002860309771da3baf2b7 100644 --- a/typo3/sysext/core/Resources/Private/Language/locallang_wizards.xlf +++ b/typo3/sysext/core/Resources/Private/Language/locallang_wizards.xlf @@ -6,36 +6,6 @@ <trans-unit id="rte_undoLastChange" resname="rte_undoLastChange"> <source>Undo/Redo last change (%s ago)</source> </trans-unit> - <trans-unit id="tsprop" resname="tsprop"> - <source>TypoScript property lookup</source> - </trans-unit> - <trans-unit id="tsprop_TSref" resname="tsprop_TSref"> - <source>TSref online</source> - </trans-unit> - <trans-unit id="tsprop_tsconfig" resname="tsprop_tsconfig"> - <source>TSconfig online</source> - </trans-unit> - <trans-unit id="tsprop_title" resname="tsprop_title"> - <source>Object title</source> - </trans-unit> - <trans-unit id="tsprop_prefix" resname="tsprop_prefix"> - <source>Object prefix</source> - </trans-unit> - <trans-unit id="tsprop_mixer_indent" resname="tsprop_mixer_indent"> - <source>Indent +2</source> - </trans-unit> - <trans-unit id="tsprop_mixer_outdent" resname="tsprop_mixer_outdent"> - <source>Outdent -2</source> - </trans-unit> - <trans-unit id="tsprop_mixer_wrap" resname="tsprop_mixer_wrap"> - <source>Wrap</source> - </trans-unit> - <trans-unit id="tsprop_mixer_transfer" resname="tsprop_mixer_transfer"> - <source>Transfer & Close</source> - </trans-unit> - <trans-unit id="tsprop_addToList" resname="tsprop_addToList"> - <source>Add to list...</source> - </trans-unit> <trans-unit id="table_title" resname="table_title"> <source>Table wizard</source> </trans-unit> diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/fe_groups.csv b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/fe_groups.csv index 93c204db6c689af197250f489cec57d4a862943c..23b14d9473c5675231e8f0d7e745f64c120d43d8 100644 --- a/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/fe_groups.csv +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/fe_groups.csv @@ -1,4 +1,4 @@ -fe_groups,,,,,,, -,uid,pid,title,subgroup,TSconfig,description,deleted -,1,0,"Group A",,,,0 -,2,0,"Group B",,,,0 +fe_groups +,uid,pid,title,subgroup,description,deleted +,1,0,"Group A",,,0 +,2,0,"Group B",,,0 diff --git a/typo3/sysext/felogin/Configuration/TCA/Overrides/fe_groups.php b/typo3/sysext/felogin/Configuration/TCA/Overrides/fe_groups.php index 6a9124672558333e96328a90cff711eb2a1c2514..9c6d7b5ad08aa86617913991a37c0187030f0567 100644 --- a/typo3/sysext/felogin/Configuration/TCA/Overrides/fe_groups.php +++ b/typo3/sysext/felogin/Configuration/TCA/Overrides/fe_groups.php @@ -18,5 +18,5 @@ call_user_func(static function () { ]; \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('fe_groups', $additionalColumns); - \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('fe_groups', 'felogin_redirectPid', '', 'after:TSconfig'); + \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('fe_groups', 'felogin_redirectPid', '', 'after:subgroup'); }); diff --git a/typo3/sysext/felogin/Configuration/TCA/Overrides/fe_users.php b/typo3/sysext/felogin/Configuration/TCA/Overrides/fe_users.php index 3ee8b7f9f3094bd04f9353dbba2609f3aba7f8bc..1d0aae5b765796c3e930f3030d779a16b8e46679 100644 --- a/typo3/sysext/felogin/Configuration/TCA/Overrides/fe_users.php +++ b/typo3/sysext/felogin/Configuration/TCA/Overrides/fe_users.php @@ -25,5 +25,5 @@ call_user_func(static function () { ]; \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('fe_users', $additionalColumns); - \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('fe_users', 'felogin_redirectPid', '', 'after:TSconfig'); + \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('fe_users', 'felogin_redirectPid', '', 'after:usergroup'); }); diff --git a/typo3/sysext/frontend/Classes/Authentication/FrontendUserAuthentication.php b/typo3/sysext/frontend/Classes/Authentication/FrontendUserAuthentication.php index cc3bffd4a7a579feba59fa904dda8c66085b840a..237ec11230ec000f476cc3e79a561074ba5708cd 100644 --- a/typo3/sysext/frontend/Classes/Authentication/FrontendUserAuthentication.php +++ b/typo3/sysext/frontend/Classes/Authentication/FrontendUserAuthentication.php @@ -124,11 +124,13 @@ class FrontendUserAuthentication extends AbstractUserAuthentication ]; /** - * Used to accumulate the TSconfig data of the user - * @var array + * @deprecated since v12, remove in v13 together with fe_users & fe_groups TSconfig TCA */ protected $TSdataArray = []; + /** + * @deprecated since v12, remove in v13 together with fe_users & fe_groups TSconfig TCA + */ protected array $userTS = []; /** @@ -273,7 +275,6 @@ class FrontendUserAuthentication extends AbstractUserAuthentication */ public function fetchGroupData(ServerRequestInterface $request) { - $this->TSdataArray = []; $this->userTS = []; $this->userGroups = []; $this->groupData = [ @@ -281,7 +282,8 @@ class FrontendUserAuthentication extends AbstractUserAuthentication 'uid' => [], 'pid' => [], ]; - // Setting default configuration: + // @deprecated since v12, remove next two lines in v13 together with fe_users & fe_groups TSconfig TCA + $this->TSdataArray = []; $this->TSdataArray[] = $GLOBALS['TYPO3_CONF_VARS']['FE']['defaultUserTSconfig']; $groupDataArr = []; @@ -307,9 +309,11 @@ class FrontendUserAuthentication extends AbstractUserAuthentication $this->groupData['title'][$groupId] = $groupData['title'] ?? ''; $this->groupData['uid'][$groupId] = $groupData['uid'] ?? 0; $this->groupData['pid'][$groupId] = $groupData['pid'] ?? 0; - $this->TSdataArray[] = $groupData['TSconfig'] ?? ''; $this->userGroups[$groupId] = $groupData; + // @deprecated since v12, remove next line in v13 together with fe_users & fe_groups TSconfig TCA + $this->TSdataArray[] = $groupData['TSconfig'] ?? ''; } + // @deprecated since v12, remove next line in v13 together with fe_users & fe_groups TSconfig TCA $this->TSdataArray[] = $this->user['TSconfig'] ?? ''; // Sort information ksort($this->groupData['title']); @@ -365,9 +369,15 @@ class FrontendUserAuthentication extends AbstractUserAuthentication * The TSconfig will be cached in $this->userTS. * * @return array TSconfig array for the fe_user + * @deprecated since v12, remove in v13 together with fe_users & fe_groups TSconfig TCA */ public function getUserTSconf() { + trigger_error( + __CLASS__ . '->' . __METHOD__ . ' is deprecated since TYPO3 v12 and will be removed with v13: Database field TSconfig' + . ' will be removed in tables fe_users and fe_groups. Use an extension specific field for such configuration instead.', + E_USER_DEPRECATED + ); if ($this->userTS === [] && !empty($this->TSdataArray)) { // Parsing the user TS (or getting from cache) $this->TSdataArray = TypoScriptParser::checkIncludeLines_array($this->TSdataArray); diff --git a/typo3/sysext/frontend/Configuration/TCA/fe_groups.php b/typo3/sysext/frontend/Configuration/TCA/fe_groups.php index a878024169397044d615dcdb04de239d915d8912..c11d9ed66b98ceef6df07102bdecb2dd04876169 100644 --- a/typo3/sysext/frontend/Configuration/TCA/fe_groups.php +++ b/typo3/sysext/frontend/Configuration/TCA/fe_groups.php @@ -66,6 +66,7 @@ return [ 'cols' => 48, ], ], + // @deprecated since v12, remove in v13 together with API in FrontendUserAuthentication, also remove in 'types' array below 'TSconfig' => [ 'exclude' => true, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:TSconfig', diff --git a/typo3/sysext/frontend/Configuration/TCA/fe_users.php b/typo3/sysext/frontend/Configuration/TCA/fe_users.php index dfbc885832bc43e702ba2a93973adc1c7e641e5e..cd710dc9661c1a9076807f3fbde69627a9df46e5 100644 --- a/typo3/sysext/frontend/Configuration/TCA/fe_users.php +++ b/typo3/sysext/frontend/Configuration/TCA/fe_users.php @@ -238,6 +238,7 @@ return [ 'cols' => 48, ], ], + // @deprecated since v12, remove in v13 together with API in FrontendUserAuthentication, also remove in 'types' array below 'TSconfig' => [ 'exclude' => true, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:TSconfig', diff --git a/typo3/sysext/frontend/Tests/Functional/Cache/fixtures.csv b/typo3/sysext/frontend/Tests/Functional/Cache/fixtures.csv index 36111fbcc6f620de0eb59d867c156a4a2cdbe3dd..d28fcdd2607a16e41cb6bc742ce49fb724fbb47f 100644 --- a/typo3/sysext/frontend/Tests/Functional/Cache/fixtures.csv +++ b/typo3/sysext/frontend/Tests/Functional/Cache/fixtures.csv @@ -20,6 +20,6 @@ ,14,2,"On page 2",0,4,2 ,15,2,"On page 2",0,4,4 ,16,2,"On page 2",0,4,5 -"fe_groups",,,,,, -,"uid","pid","title","description","subgroup","TSconfig" -,1,2,"Test fe group on page 2","Test only",, +"fe_groups" +,"uid","pid","title","description" +,1,2,"Test fe group on page 2","Test only" diff --git a/typo3/sysext/frontend/Tests/Functional/Tca/FrontendGroupsVisibleFieldsTest.php b/typo3/sysext/frontend/Tests/Functional/Tca/FrontendGroupsVisibleFieldsTest.php index 0a2f9c4c000850ceefbd1dee99d7264f8bd0c9e0..8dbde400ed3746387490d6819046428e668ad1e7 100644 --- a/typo3/sysext/frontend/Tests/Functional/Tca/FrontendGroupsVisibleFieldsTest.php +++ b/typo3/sysext/frontend/Tests/Functional/Tca/FrontendGroupsVisibleFieldsTest.php @@ -29,7 +29,6 @@ class FrontendGroupsVisibleFieldsTest extends FunctionalTestCase 'title', 'description', 'subgroup', - 'TSconfig', 'tx_extbase_type', ]; diff --git a/typo3/sysext/frontend/Tests/Functional/Tca/FrontendUsersVisibleFieldsTest.php b/typo3/sysext/frontend/Tests/Functional/Tca/FrontendUsersVisibleFieldsTest.php index d349e0fb42f43c12b272e585f089e9c77afd78b5..c5e16a06e5ae73c0b624a96762b9039b9cc1abc3 100644 --- a/typo3/sysext/frontend/Tests/Functional/Tca/FrontendUsersVisibleFieldsTest.php +++ b/typo3/sysext/frontend/Tests/Functional/Tca/FrontendUsersVisibleFieldsTest.php @@ -44,7 +44,6 @@ class FrontendUsersVisibleFieldsTest extends FunctionalTestCase 'email', 'www', 'image', - 'TSconfig', 'starttime', 'endtime', 'tx_extbase_type', diff --git a/typo3/sysext/frontend/ext_tables.sql b/typo3/sysext/frontend/ext_tables.sql index 6f99a765a2c17b66e0643fcf1c836c7d2c5741eb..1e4a88d0ccf54e524439c6befe6c53a53c8aa35f 100644 --- a/typo3/sysext/frontend/ext_tables.sql +++ b/typo3/sysext/frontend/ext_tables.sql @@ -13,6 +13,7 @@ CREATE TABLE cache_treelist ( # # Table structure for table 'fe_groups' +# @deprecated field TSconfig since v12, remove in v13 together with fe_users & fe_groups TSconfig TCA # CREATE TABLE fe_groups ( title varchar(50) DEFAULT '' NOT NULL, @@ -38,6 +39,7 @@ CREATE TABLE fe_sessions ( # # Table structure for table 'fe_users' +# @deprecated field TSconfig since v12, remove in v13 together with fe_users & fe_groups TSconfig TCA # CREATE TABLE fe_users ( username varchar(255) DEFAULT '' NOT NULL, diff --git a/typo3/sysext/install/Configuration/ExtensionScanner/Php/ArrayDimensionMatcher.php b/typo3/sysext/install/Configuration/ExtensionScanner/Php/ArrayDimensionMatcher.php index 1b52919921f61074f898175e74662a24d3babb07..ee61615b05f690c3406fdadf2a2ee0f7816e09cd 100644 --- a/typo3/sysext/install/Configuration/ExtensionScanner/Php/ArrayDimensionMatcher.php +++ b/typo3/sysext/install/Configuration/ExtensionScanner/Php/ArrayDimensionMatcher.php @@ -946,4 +946,9 @@ return [ 'Breaking-98490-VariousHooksAndMethodsChangedInDatabaseRecordList.rst', ], ], + '$GLOBALS[\'TYPO3_CONF_VARS\'][\'FE\'][\'defaultUserTSconfig\']' => [ + 'restFiles' => [ + 'Deprecation-99075-Fe_usersAndFe_groupsTSconfig.rst', + ], + ], ]; diff --git a/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php b/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php index 76e11edd0491cd70dced9d7521928ea6dbfd7353..64bedd7a3cbe2f66de5aa2f2d9195690f565f3ee 100644 --- a/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php +++ b/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php @@ -5372,4 +5372,11 @@ return [ 'Deprecation-97536-LinkResultFactory.rst', ], ], + 'TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication->getUserTSconf' => [ + 'numberOfMandatoryArguments' => 0, + 'maximumNumberOfArguments' => 0, + 'restFiles' => [ + 'Deprecation-99075-Fe_usersAndFe_groupsTSconfig.rst', + ], + ], ];