From c2d30f5478d1e322f1693baa84bf85c8bab1edb7 Mon Sep 17 00:00:00 2001 From: Benni Mack <benni@typo3.org> Date: Fri, 3 Nov 2017 15:52:51 +0100 Subject: [PATCH] [TASK] Remove TypoScript option config.typolinkCheckRootline The TypoScript option 'config.typolinkCheckRootline' was introduced back in TYPO3 v4.x when there was no proper rootline cache or sys_domain cache in place, in order to resolve the proper domain. This now has changed, and this option can be removed in order to simplify page link generation. When in a multi-site setup, this option MUST be active otherwise it will result in ugly and hard-to-debug side-effects. For a single-site setup having this option disabled will result in a marginal performance decrease (one SQL query more) when linking to a page with a sys_domain record available. A deprecation notice is thrown if your TypoScript setup still includes this option. Resolves: #82909 Releases: master Change-Id: I36abcdd1e2eabe2da66d8edd720a5a27ec306ede Reviewed-on: https://review.typo3.org/54545 Reviewed-by: Oliver Hader <oliver.hader@typo3.org> Tested-by: TYPO3com <no-reply@typo3.com> Tested-by: Oliver Hader <oliver.hader@typo3.org> Reviewed-by: Frans Saris <franssaris@gmail.com> Reviewed-by: Susanne Moog <susanne.moog@typo3.org> Tested-by: Susanne Moog <susanne.moog@typo3.org> --- ...criptOptionConfigtypolinkCheckRootline.rst | 32 +++++++++++++++++++ .../TypoScriptFrontendController.php | 5 +-- .../Classes/Typolink/PageLinkBuilder.php | 2 +- .../t3editor/Resources/Private/tsref.xml | 9 ------ .../JavaScript/Mode/typoscript/typoscript.js | 1 - 5 files changed, 36 insertions(+), 13 deletions(-) create mode 100644 typo3/sysext/core/Documentation/Changelog/master/Deprecation-82909-TypoScriptOptionConfigtypolinkCheckRootline.rst diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-82909-TypoScriptOptionConfigtypolinkCheckRootline.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-82909-TypoScriptOptionConfigtypolinkCheckRootline.rst new file mode 100644 index 000000000000..99eefe69ed04 --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-82909-TypoScriptOptionConfigtypolinkCheckRootline.rst @@ -0,0 +1,32 @@ +.. include:: ../../Includes.txt + +==================================================================== +Deprecation: #82909 - TypoScript option config.typolinkCheckRootline +==================================================================== + +See :issue:`82909` + +Description +=========== + +The TypoScript option `config.typolinkCheckRootline` is now always active. + + +Impact +====== + +Setting this option in TypoScript setup will trigger a deprecation warning. + + +Affected Installations +====================== + +Any installation having this option set. + + +Migration +========= + +Just remove the TypoScript instruction, as it is not needed anymore. + +.. index:: TypoScript, NotScanned \ 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 5254dd8c9772..08d6d03fe962 100644 --- a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php +++ b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php @@ -2460,8 +2460,9 @@ class TypoScriptFrontendController implements LoggerAwareInterface if (is_array($this->pSetup['config.'])) { ArrayUtility::mergeRecursiveWithOverrule($this->config['config'], $this->pSetup['config.']); } - if ($this->config['config']['typolinkEnableLinksAcrossDomains']) { - $this->config['config']['typolinkCheckRootline'] = true; + // @deprecated since TYPO3 v9, can be removed in TYPO3 v10 + if ($this->config['config']['typolinkCheckRootline']) { + $this->logDeprecatedTyposcript('config.typolinkCheckRootline', 'The functionality is always enabled since TYPO3 v9 and can be removed from your TypoScript code'); } // Set default values for removeDefaultJS and inlineStyle2TempFile so CSS and JS are externalized if compatversion is higher than 4.0 if (!isset($this->config['config']['removeDefaultJS'])) { diff --git a/typo3/sysext/frontend/Classes/Typolink/PageLinkBuilder.php b/typo3/sysext/frontend/Classes/Typolink/PageLinkBuilder.php index d3ac05b32582..fe40f612505c 100644 --- a/typo3/sysext/frontend/Classes/Typolink/PageLinkBuilder.php +++ b/typo3/sysext/frontend/Classes/Typolink/PageLinkBuilder.php @@ -113,7 +113,7 @@ class PageLinkBuilder extends AbstractTypolinkBuilder if (!empty($MPvarAcc)) { // Add "&MP" var: $addQueryParams .= '&MP=' . rawurlencode(implode(',', $MPvarAcc)); - } elseif (strpos($addQueryParams, '&MP=') === false && $tsfe->config['config']['typolinkCheckRootline']) { + } elseif (strpos($addQueryParams, '&MP=') === false) { // We do not come here if additionalParams had '&MP='. This happens when typoLink is called from // menu. Mount points always work in the content of the current domain and we must not change // domain if MP variables exist. diff --git a/typo3/sysext/t3editor/Resources/Private/tsref.xml b/typo3/sysext/t3editor/Resources/Private/tsref.xml index 69ecad8a54f3..bbf1a280d890 100644 --- a/typo3/sysext/t3editor/Resources/Private/tsref.xml +++ b/typo3/sysext/t3editor/Resources/Private/tsref.xml @@ -817,13 +817,6 @@ Internally, the value is depending on whether a Alternative Page Language record <description><![CDATA[function-name Passes the default <title>-tag content to this function. No typoScript parameters are passed though.]]></description> <default><![CDATA[ -]]></default> - </property> - <property name="typolinkCheckRootline" type="boolean"> - <description><![CDATA[If set, then every "typolink" is checked whether it's linking to a page within the current rootline of the site. -If not, then TYPO3 searches for the first found domain record (without redirect) in that rootline from out to in. -If found (another domain), then that domain is prepended the link, the external target is used instead and thus the link jumps to the page in the correct domain.]]></description> - <default><![CDATA[ ]]></default> </property> <property name="typolinkEnableLinksAcrossDomains" type="boolean"> @@ -837,8 +830,6 @@ If this option is not set, then all cross-domain links will be generated as - all domains have identical localization settings (config.sys_language_XXX directives) - all domains have the same set of languages defined -This option implies "config.typolinkCheckRootline=1", which will be activated automatically. Setting value of "config. typolinkCheckRootline" inside TS template will have no effect. - Disclaimer: it must be understood that while link is generated to another domain, it is still generated in the context of current domain. No side effects are known at the time of writing of this documentation but they may exist. If any side effects are found, this documentation will be updated to include them.]]></description> <default><![CDATA[ ]]></default> diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/Mode/typoscript/typoscript.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/Mode/typoscript/typoscript.js index b61f92923150..8d585a7d36e2 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/Mode/typoscript/typoscript.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/Mode/typoscript/typoscript.js @@ -902,7 +902,6 @@ 'typeNum': kw('typeNum'), 'types': kw('types'), 'typolink': A, - 'typolinkCheckRootline': kw('typolinkCheckRootline'), 'uid': B, 'uidInList': kw('uidInList'), 'uniqueGlobal': B, -- GitLab