[BUGFIX] Initialize pagesTSconfig for link handler in FE 19/52619/2
authorBenni Mack <benni@typo3.org>
Wed, 26 Apr 2017 18:56:45 +0000 (20:56 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Thu, 27 Apr 2017 08:43:39 +0000 (10:43 +0200)
In TYPO3 v8, $TSFE->pagesTSconfig is only initialized
when the frontend editing is active, but the link handler depends on the
value of pageTSconfig, for this reason, the method for initializing
should be used instead of the public property.

Resolves: #80883
Releases: master, 8.7
Change-Id: I6e7519c23f34867850160135ea8798911907338b
Reviewed-on: https://review.typo3.org/52619
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Thomas Hohn <thomas@hohn.dk>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/frontend/Classes/Typolink/DatabaseRecordLinkBuilder.php

index ca47842..5655413 100644 (file)
@@ -29,9 +29,10 @@ class DatabaseRecordLinkBuilder extends AbstractTypolinkBuilder
     public function build(array &$linkDetails, string $linkText, string $target, array $conf): array
     {
         $tsfe = $this->getTypoScriptFrontendController();
+        $pageTsConfig = $tsfe->getPagesTSconfig();
         $configurationKey = $linkDetails['identifier'] . '.';
         $configuration = $tsfe->tmpl->setup['config.']['recordLinks.'];
-        $linkHandlerConfiguration = $tsfe->pagesTSconfig['TCEMAIN.']['linkHandler.'];
+        $linkHandlerConfiguration = $pageTsConfig['TCEMAIN.']['linkHandler.'];
 
         if (!isset($configuration[$configurationKey]) || !isset($linkHandlerConfiguration[$configurationKey])) {
             throw new UnableToLinkException(