Skip to content

Commit

Permalink
[!!!][TASK] Remove deprecated EMU addPageTSConfig & addUserTSConfig
Browse files Browse the repository at this point in the history
Handling of

$GLOBALS['TYPO3_CONF_VARS']['BE']['defaultPageTSconfig']
$GLOBALS['TYPO3_CONF_VARS']['BE']['defaultUserTSconfig']

and methods

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig()
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig()

Resolves: #105464
Related: #105377
Related: #101799
Related: #101807
Releases: main
Change-Id: Iba9978d8e9940e7e363871295782fd28b6f8c154
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/86780
Reviewed-by: Christian Kuhn <[email protected]>
Tested-by: core-ci <[email protected]>
Tested-by: Garvin Hicking <[email protected]>
Reviewed-by: Garvin Hicking <[email protected]>
Tested-by: Andreas Kienast <[email protected]>
Tested-by: Christian Kuhn <[email protected]>
Reviewed-by: Andreas Kienast <[email protected]>
  • Loading branch information
lolli42 committed Oct 25, 2024
1 parent 3ab1856 commit c19ee15
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 103 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,6 @@ public function getUserTsConfigTree(
$includeTree->addChild($this->getTreeFromString((string)$key, $typoScriptString, $tokenizer, $cache));
}

// @deprecated since TYPO3 v13. Remove in v14 along with defaultUserTSconfig and EMU::addUserTSConfig
if (!empty($GLOBALS['TYPO3_CONF_VARS']['BE']['defaultUserTSconfig'] ?? '')) {
$includeTree->addChild($this->getTreeFromString('userTsConfig-globals', $GLOBALS['TYPO3_CONF_VARS']['BE']['defaultUserTSconfig'], $tokenizer, $cache));
}

foreach ($backendUser->userGroupsUID as $groupId) {
// Loop through all groups and add their 'TSconfig' fields
if (!empty($backendUser->userGroups[$groupId]['TSconfig'] ?? '')) {
Expand All @@ -124,11 +119,6 @@ public function getPagesTsConfigTree(

$collectedPagesTsConfigArray += $this->getPackagePageTsConfigTree($cache);

// @deprecated since TYPO3 v13. Remove in v14 along with defaultPageTSconfig and EMU::addPageTSConfig
if (!empty($GLOBALS['TYPO3_CONF_VARS']['BE']['defaultPageTSconfig'] ?? '')) {
$collectedPagesTsConfigArray['pagesTsConfig-globals-defaultPageTSconfig'] = ['content' => $GLOBALS['TYPO3_CONF_VARS']['BE']['defaultPageTSconfig']];
}

// HEADS up: rootLine may be modified by getSitePagesTsConfigTree
$collectedPagesTsConfigArray += $this->getSitePageTsConfigTree($rootLine, $cache);

Expand Down
28 changes: 0 additions & 28 deletions typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -606,34 +606,6 @@ protected static function removeDuplicatesForInsertion(string $insertionList, st
return implode(', ', $cleanInsertionListParts);
}

/**
* Adds $content to the default page TSconfig as set in $GLOBALS['TYPO3_CONF_VARS'][BE]['defaultPageTSconfig']
*
* @deprecated since TYPO3 v13.0, will be removed in TYPO3 v14.0.
*/
public static function addPageTSConfig(string $content): void
{
trigger_error(
'ExtensionManagementUtility::addPageTSConfig() has been deprecated in TYPO3 v13.0 and will be removed in v14.0. Use Configuration/page.tsconfig files in extensions instead.',
E_USER_DEPRECATED
);
$GLOBALS['TYPO3_CONF_VARS']['BE']['defaultPageTSconfig'] .= chr(10) . $content;
}

/**
* Adds $content to the default user TSconfig as set in $GLOBALS['TYPO3_CONF_VARS'][BE]['defaultUserTSconfig']
*
* @deprecated since TYPO3 v13.0, will be removed in TYPO3 v14.0.
*/
public static function addUserTSConfig(string $content): void
{
trigger_error(
'ExtensionManagementUtility::addUserTSConfig() has been deprecated in TYPO3 v13.0 and will be removed in v14.0. Use Configuration/user.tsconfig files in extensions instead.',
E_USER_DEPRECATED
);
$GLOBALS['TYPO3_CONF_VARS']['BE']['defaultUserTSconfig'] .= chr(10) . $content;
}

/**************************************
*
* Adding SERVICES features
Expand Down
2 changes: 0 additions & 2 deletions typo3/sysext/core/Configuration/DefaultConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -1344,8 +1344,6 @@
'compressionLevel' => 0,
'installToolPassword' => '',
'contentSecurityPolicyReportingUrl' => '',
'defaultUserTSconfig' => '', // @deprecated since TYPO3 v13.0, will be removed in TYPO3 v14.0. Add to SilentConfigurationUpgradeService.
'defaultPageTSconfig' => '', // @deprecated since TYPO3 v13.0, will be removed in TYPO3 v14.0. Add to SilentConfigurationUpgradeService.
// String (exclude).Enter lines of default page TSconfig.
'defaultPermissions' => [],
'defaultUC' => [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ The following PHP static class methods that have previously been marked as depre
- :php:`\TYPO3\CMS\Backend\Utility\BackendUtility::thumbCode()`
- :php:`\TYPO3\CMS\Core\Utility\GeneralUtility::hmac()`
- :php:`\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43()`
- :php:`\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig()`
- :php:`\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig()`
- :php:`\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getExtensionIcon()`
- :php:`\TYPO3\CMS\Core\Utility\MathUtility::convertToPositiveInteger()`
- :php:`\TYPO3\CMS\Core\Versioning\VersionState::cast()`
Expand Down Expand Up @@ -197,7 +199,8 @@ The following class constants have been dropped:

The following global option handling have been dropped and are ignored:

- :php:`$GLOBALS['TYPO3_CONF_VARS']['X']['Y']`
- :php:`$GLOBALS['TYPO3_CONF_VARS']['BE']['defaultPageTSconfig']`
- :php:`$GLOBALS['TYPO3_CONF_VARS']['BE']['defaultUserTSconfig']`

The following global variables have been removed:

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -195,30 +195,4 @@ public function pageTsConfigCanBeOverloadedWithUserTsConfig(): void
$pageTsConfig = $subject->create($rootLine, new NullSite(), $userTsConfig);
self::assertSame('overridden', $pageTsConfig->getPageTsConfigArray()['valueOverriddenByUserTsConfig']);
}

/**
* @deprecated Remove together with $GLOBALS['TYPO3_CONF_VARS']['BE']['defaultPageTSconfig'].
*/
#[Test]
public function pageTsConfigLoadsDefaultsFromGlobals(): void
{
$GLOBALS['TYPO3_CONF_VARS']['BE']['defaultPageTSconfig'] = 'loadedFromGlobals = loadedFromGlobals';
$subject = $this->get(PageTsConfigFactory::class);
$pageTsConfig = $subject->create([], new NullSite());
self::assertSame('loadedFromGlobals', $pageTsConfig->getPageTsConfigArray()['loadedFromGlobals']);
}

/**
* @deprecated Remove together with $GLOBALS['TYPO3_CONF_VARS']['BE']['defaultPageTSconfig'] and INCLUDE_TYPOSCRIPT
*/
#[Test]
#[IgnoreDeprecations]
public function pageTsConfigLoadsSingleFileWithOldImportSyntaxFromGlobals(): void
{
$GLOBALS['TYPO3_CONF_VARS']['BE']['defaultPageTSconfig'] = '<INCLUDE_TYPOSCRIPT: source="FILE:EXT:test_typoscript_pagetsconfigfactory/Configuration/TsConfig/tsconfig-includes.tsconfig">';
/** @var PageTsConfigFactory $subject */
$subject = $this->get(PageTsConfigFactory::class);
$pageTsConfig = $subject->create([], new NullSite());
self::assertSame('loadedFromTsconfigIncludesWithTsconfigSuffix', $pageTsConfig->getPageTsConfigArray()['loadedFromTsconfigIncludesWithTsconfigSuffix']);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

namespace TYPO3\CMS\Core\Tests\Functional\TypoScript;

use PHPUnit\Framework\Attributes\IgnoreDeprecations;
use PHPUnit\Framework\Attributes\Test;
use TYPO3\CMS\Core\TypoScript\UserTsConfigFactory;
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
Expand Down Expand Up @@ -90,36 +89,4 @@ public function userTsConfigLoadsFromWildcardAtImportWithTypoScriptSuffix(): voi
$userTsConfig = $subject->create($backendUser);
self::assertSame('loadedFromTsconfigIncludesWithTyposcriptSuffix', $userTsConfig->getUserTsConfigArray()['loadedFromTsconfigIncludesWithTyposcriptSuffix']);
}

/**
* @deprecated Remove together with $GLOBALS['TYPO3_CONF_VARS']['BE']['defaultUserTSconfig'] handling.
* Remove Fixtures/userTsConfigTestFixtureDeprecated.csv as well.
*/
#[Test]
public function userTsConfigLoadsDefaultFromGlobals(): void
{
$GLOBALS['TYPO3_CONF_VARS']['BE']['defaultUserTSconfig'] = 'loadedFromGlobals = loadedFromGlobals';
$this->importCSVDataSet(__DIR__ . '/Fixtures/userTsConfigTestFixtureDeprecated.csv');
$backendUser = $this->setUpBackendUser(1);
$subject = $this->get(UserTsConfigFactory::class);
$userTsConfig = $subject->create($backendUser);
self::assertSame('loadedFromGlobals', $userTsConfig->getUserTsConfigArray()['loadedFromGlobals']);
}

/**
* @deprecated Remove together with $GLOBALS['TYPO3_CONF_VARS']['BE']['defaultUserTSconfig'] handling and INCLUDE_TYPOSCRIPT
* Remove Fixtures/userTsConfigTestFixtureDeprecated.csv as well.
*/
#[Test]
#[IgnoreDeprecations]
public function userTsConfigLoadsSingleFileWithOldImportSyntaxFromGlobals(): void
{
$GLOBALS['TYPO3_CONF_VARS']['BE']['defaultUserTSconfig'] = '<INCLUDE_TYPOSCRIPT: source="FILE:EXT:test_typoscript_usertsconfigfactory/Configuration/TsConfig/tsconfig-includes.tsconfig">';
$this->importCSVDataSet(__DIR__ . '/Fixtures/userTsConfigTestFixtureDeprecated.csv');
$backendUser = $this->setUpBackendUser(1);
/** @var UserTsConfigFactory $subject */
$subject = $this->get(UserTsConfigFactory::class);
$userTsConfig = $subject->create($backendUser);
self::assertSame('loadedFromTsconfigIncludesWithTsconfigSuffix', $userTsConfig->getUserTsConfigArray()['loadedFromTsconfigIncludesWithTsconfigSuffix']);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ class SilentConfigurationUpgradeService
'FE/addRootLineFields',
// #104104
'EXTENSIONS/indexed_search/debugMode',
// #101807
'BE/defaultUserTSconfig',
// #101799
'BE/defaultPageTSconfig',
];

public function __construct(private readonly ConfigurationManager $configurationManager) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1039,11 +1039,13 @@
'$GLOBALS[\'TYPO3_CONF_VARS\'][\'BE\'][\'defaultPageTSconfig\']' => [
'restFiles' => [
'Deprecation-101799-ExtensionManagementUtilityaddPageTSConfig.rst',
'Breaking-105377-DeprecatedFunctionalityRemoved.rst',
],
],
'$GLOBALS[\'TYPO3_CONF_VARS\'][\'BE\'][\'defaultUserTSconfig\']' => [
'restFiles' => [
'Deprecation-101807-ExtensionManagementUtilityaddUserTSConfig.rst',
'Breaking-105377-DeprecatedFunctionalityRemoved.rst',
],
],
'$GLOBALS[\'TCA\'][\'someTable\'][\'types\'][\'bitmask_excludelist_bits\']' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1585,13 +1585,15 @@
'maximumNumberOfArguments' => 1,
'restFiles' => [
'Deprecation-101799-ExtensionManagementUtilityaddPageTSConfig.rst',
'Breaking-105377-DeprecatedFunctionalityRemoved.rst',
],
],
'TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig' => [
'numberOfMandatoryArguments' => 1,
'maximumNumberOfArguments' => 1,
'restFiles' => [
'Deprecation-101807-ExtensionManagementUtilityaddUserTSConfig.rst',
'Breaking-105377-DeprecatedFunctionalityRemoved.rst',
],
],
'TYPO3\CMS\Core\Imaging\GraphicalFunctions::gifCompress' => [
Expand Down

0 comments on commit c19ee15

Please sign in to comment.