Skip to content
Snippets Groups Projects
Commit 09b5f2b7 authored by Benni Mack's avatar Benni Mack Committed by Georg Ringer
Browse files

[TASK] Deprecate TSFE->divSection

DivSection was used to create GMENU_LAYERS functionality,
injecting global inline JavaScript right after the rendered pages'
<body> tag.

GMENU_LAYERS was removed with TYPO3 v8, however the property
was still replaced every single time in the TYPO3 Frontend when
a USER_INT was on the page. This is not needed anymore, marking
the property as unused. That's why it is deprecated.

Resolves: #89722
Releases: master
Change-Id: Ia8e3910e20bc28831ba3bdce143812f8acb9d139
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62347


Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: default avatarGeorg Ringer <georg.ringer@gmail.com>
Reviewed-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: default avatarGeorg Ringer <georg.ringer@gmail.com>
parent 82c96c43
Branches
Tags
No related merge requests found
.. 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
......@@ -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));
......
......@@ -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>
......
......@@ -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' => [
......
......@@ -631,4 +631,9 @@ return [
'Deprecation-89127-CleanupRecordHistoryHandling.rst',
],
],
'TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->divSection' => [
'restFiles' => [
'Deprecation-89722-GMENU_LAYERSRelatedPropertyTSFE-divSection.rst',
],
],
];
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment