diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-89722-GMENU_LAYERSRelatedPropertyTSFE-divSection.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-89722-GMENU_LAYERSRelatedPropertyTSFE-divSection.rst new file mode 100644 index 0000000000000000000000000000000000000000..1b8add2c01400e816650679386623cb00b8b5f79 --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-89722-GMENU_LAYERSRelatedPropertyTSFE-divSection.rst @@ -0,0 +1,36 @@ +.. include:: ../../Includes.txt + +==================================================================== +Deprecation: #89722 - GMENU_LAYERS related property TSFE->divSection +==================================================================== + +See :issue:`89722` + +Description +=========== + +The public PHP property :php:`TypoScriptFrontendController->divSection` has been marked as deprecated. This was used in prior +TYPO3 versions to add dynamic JavaScript related to GMENU_LAYERS +functionality which was removed with previous TYPO3 versions, making +this property only produce unnecessary overhead in frontend rendering. + + +Impact +====== + +Accessing or setting this property will trigger a deprecation notice. + + +Affected Installations +====================== + +TYPO3 installations with extensions explicitly accessing this property, which is highly unlikely as this property is very lowlevel. + + +Migration +========= + +If there is a need to add JavaScript within uncached content, use +:php:`$GLOBALS['TSFE']->additionalHeaderData[]` instead. + +.. index:: Frontend, FullyScanned, ext:frontend \ No newline at end of file diff --git a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php index 27b6dd9389e98857170894d0be6aae77f7f0c67a..efd8180d6a35da2639386c0f984dc6ad3d175cc1 100644 --- a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php +++ b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php @@ -398,6 +398,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface /** * Used to accumulate DHTML-layers. * @var string + * @deprecated since TYPO3 v10.2, will be removed in TYPO3 v11, use custom USER_INT objects instead. */ public $divSection = ''; @@ -2952,7 +2953,6 @@ class TypoScriptFrontendController implements LoggerAwareInterface : []; $this->additionalJavaScript = $this->config['INTincScript_ext']['additionalJavaScript'] ?? null; $this->additionalCSS = $this->config['INTincScript_ext']['additionalCSS'] ?? null; - $this->divSection = ''; if (empty($this->config['INTincScript_ext']['pageRenderer'])) { $this->initPageRenderer(); } else { @@ -2971,12 +2971,10 @@ class TypoScriptFrontendController implements LoggerAwareInterface [ '<!--HD_' . $this->config['INTincScript_ext']['divKey'] . '-->', '<!--FD_' . $this->config['INTincScript_ext']['divKey'] . '-->', - '<!--TDS_' . $this->config['INTincScript_ext']['divKey'] . '-->' ], [ $this->convOutputCharset(implode(LF, $this->additionalHeaderData)), $this->convOutputCharset(implode(LF, $this->additionalFooterData)), - $this->convOutputCharset($this->divSection), ], $this->pageRenderer->renderJavaScriptAndCssForProcessingOfUncachedContentObjects($this->content, $this->config['INTincScript_ext']['divKey']) ); @@ -3082,7 +3080,6 @@ class TypoScriptFrontendController implements LoggerAwareInterface $this->additionalHeaderData = ['<!--HD_' . $this->config['INTincScript_ext']['divKey'] . '-->']; // Clearing the array $this->additionalFooterData = ['<!--FD_' . $this->config['INTincScript_ext']['divKey'] . '-->']; - $this->divSection .= '<!--TDS_' . $this->config['INTincScript_ext']['divKey'] . '-->'; } else { // Add javascript in a "regular" fashion $jsCode = trim($this->JSCode); @@ -4024,6 +4021,9 @@ class TypoScriptFrontendController implements LoggerAwareInterface case 'sys_language_isocode': trigger_error('Property $TSFE->sys_language_isocode is not in use anymore as this information is now stored within the SiteLanguage object. Will be removed in TYPO3 v11.0.', E_USER_DEPRECATED); return isset($this->$propertyName); + case 'divSection': + trigger_error('Property $TSFE->divSection is not in use anymore. Will be removed in TYPO3 v11.0.', E_USER_DEPRECATED); + return isset($this->$propertyName); case 'fePreview': trigger_error('Property $TSFE->fePreview is not in use anymore as this information is now stored within the FrontendPreview aspect.', E_USER_DEPRECATED); return $this->context->hasAspect('frontend.preview'); @@ -4059,6 +4059,9 @@ class TypoScriptFrontendController implements LoggerAwareInterface case 'sys_language_isocode': trigger_error('Property $TSFE->sys_language_isocode is not in use anymore as this information is now stored within the SiteLanguage object. Will be removed in TYPO3 v11.0.', E_USER_DEPRECATED); return $this->sys_language_isocode ?? $this->language->getTwoLetterIsoCode(); + case 'divSection': + trigger_error('Property $TSFE->divSection is not in use anymore. Will be removed in TYPO3 v11.0.', E_USER_DEPRECATED); + break; case 'fePreview': trigger_error('Property $TSFE->fePreview is not in use anymore as this information is now stored within the FrontendPreview aspect.', E_USER_DEPRECATED); if ($this->context->hasAspect('frontend.preview')) { @@ -4101,6 +4104,9 @@ class TypoScriptFrontendController implements LoggerAwareInterface case 'sys_language_isocode': trigger_error('Property $TSFE->sys_language_isocode is not in use anymore as this information is now stored within the SiteLanguage object. Will be removed in TYPO3 v11.0.', E_USER_DEPRECATED); break; + case 'divSection': + trigger_error('Property $TSFE->divSection is not in use anymore. Will be removed in TYPO3 v11.0.', E_USER_DEPRECATED); + break; case 'fePreview': trigger_error('Property $TSFE->fePreview is not in use anymore as this information is now stored within the FrontendPreview aspect.', E_USER_DEPRECATED); $this->context->setAspect('frontend.preview', GeneralUtility::makeInstance(PreviewAspect::class, (bool)$propertyValue)); @@ -4133,6 +4139,9 @@ class TypoScriptFrontendController implements LoggerAwareInterface case 'sys_language_isocode': trigger_error('Property $TSFE->sys_language_isocode is not in use anymore as this information is now stored within the SiteLanguage object. Will be removed in TYPO3 v11.0.', E_USER_DEPRECATED); break; + case 'divSection': + trigger_error('Property $TSFE->divSection is not in use anymore. Will be removed in TYPO3 v11.0.', E_USER_DEPRECATED); + break; case 'fePreview': trigger_error('Property $TSFE->fePreview is not in use anymore as this information is now stored within the FrontendPreview aspect.', E_USER_DEPRECATED); $this->context->setAspect('frontend.preview', GeneralUtility::makeInstance(PreviewAspect::class, false)); diff --git a/typo3/sysext/frontend/Tests/Unit/Controller/Fixtures/renderedPage.html b/typo3/sysext/frontend/Tests/Unit/Controller/Fixtures/renderedPage.html index 492020243f5457d9f3bfbe6ba8e0589f57ee060e..412deeef94f711f4929e539a2bfffb37e2dadcbd 100644 --- a/typo3/sysext/frontend/Tests/Unit/Controller/Fixtures/renderedPage.html +++ b/typo3/sysext/frontend/Tests/Unit/Controller/Fixtures/renderedPage.html @@ -14,7 +14,7 @@ <title>powermail</title> -<meta name="generator" content="TYPO3 6.0 CMS"> +<meta name="generator" content="TYPO3 10.4 CMS"> <link rel="stylesheet" type="text/css" href="typo3temp/assets/css/427bb03fe1.css?1334416344" media="all"> @@ -26,7 +26,6 @@ <!--HD_679b52796e75d474ccbbed486b6837ab--> </head> <body> -<!--TDS_679b52796e75d474ccbbed486b6837ab--> <!-- CONTENT ELEMENT, uid:65/login [begin] --> <div id="c65" class="csc-default csc-space-before- csc-space-after-"><!--INT_SCRIPT.13e1737dd0938292520612f3088602ba--></div> diff --git a/typo3/sysext/frontend/Tests/Unit/Controller/TypoScriptFrontendControllerTest.php b/typo3/sysext/frontend/Tests/Unit/Controller/TypoScriptFrontendControllerTest.php index 49ff737cf386ddfeff43c3a6503f77a8c28681ed..30128ff5911068ff1c841b4845704e15f960eac4 100644 --- a/typo3/sysext/frontend/Tests/Unit/Controller/TypoScriptFrontendControllerTest.php +++ b/typo3/sysext/frontend/Tests/Unit/Controller/TypoScriptFrontendControllerTest.php @@ -79,7 +79,7 @@ class TypoScriptFrontendControllerTest extends UnitTestCase /** * This is the callback that mimics a USER_INT extension */ - public function INTincScript_processCallback() + public function processNonCacheableContentPartsAndSubstituteContentMarkers() { $GLOBALS['TSFE']->additionalHeaderData[] = 'headerData'; $GLOBALS['TSFE']->additionalFooterData[] = 'footerData'; @@ -96,13 +96,13 @@ class TypoScriptFrontendControllerTest extends UnitTestCase /** @var \PHPUnit\Framework\MockObject\MockObject|TypoScriptFrontendController $tsfe */ $tsfe = $this->getMockBuilder(TypoScriptFrontendController::class) ->setMethods([ - 'INTincScript_process', + 'processNonCacheableContentPartsAndSubstituteContentMarkers', 'INTincScript_loadJSCode', 'setAbsRefPrefix', 'regeneratePageTitle' ])->disableOriginalConstructor() ->getMock(); - $tsfe->expects(self::exactly(2))->method('processNonCacheableContentPartsAndSubstituteContentMarkers')->willReturnCallback([$this, 'INTincScript_processCallback']); + $tsfe->expects(self::exactly(2))->method('processNonCacheableContentPartsAndSubstituteContentMarkers')->willReturnCallback([$this, 'processNonCacheableContentPartsAndSubstituteContentMarkers']); $tsfe->content = file_get_contents(__DIR__ . '/Fixtures/renderedPage.html'); $config = [ 'INTincScript_ext' => [ diff --git a/typo3/sysext/install/Configuration/ExtensionScanner/Php/PropertyPublicMatcher.php b/typo3/sysext/install/Configuration/ExtensionScanner/Php/PropertyPublicMatcher.php index 7acf792f269c54f38ee20446f801fcb00266e8ef..fa57ffd179e22cb6532ebe8d8896b00be6e30985 100644 --- a/typo3/sysext/install/Configuration/ExtensionScanner/Php/PropertyPublicMatcher.php +++ b/typo3/sysext/install/Configuration/ExtensionScanner/Php/PropertyPublicMatcher.php @@ -631,4 +631,9 @@ return [ 'Deprecation-89127-CleanupRecordHistoryHandling.rst', ], ], + 'TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->divSection' => [ + 'restFiles' => [ + 'Deprecation-89722-GMENU_LAYERSRelatedPropertyTSFE-divSection.rst', + ], + ], ];