[BUGFIX] Load PageTSconfig in localconf for LinkHandler 47/52647/2
authorBenni Mack <benni@typo3.org>
Fri, 28 Apr 2017 08:49:04 +0000 (10:49 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Fri, 28 Apr 2017 09:03:06 +0000 (11:03 +0200)
The pageTSconfig for LinkHandler is only loaded in ext_tables.php
which means it is only evaluated in the Frontend when a Backend User
is logged in.

However the functionality did work before, if a compiled pageTS was
available in the cache. This could have happened that the pageTS cache
was filled while a BE user was logged in, so it worked (but only in
random cases).

Resolves: #81057
Releases: master, 8.7
Change-Id: I2a2462799a492af2dac90778c51c29cc5c11a782
Reviewed-on: https://review.typo3.org/52647
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/recordlist/ext_localconf.php [new file with mode: 0644]
typo3/sysext/recordlist/ext_tables.php

diff --git a/typo3/sysext/recordlist/ext_localconf.php b/typo3/sysext/recordlist/ext_localconf.php
new file mode 100644 (file)
index 0000000..b325ac5
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+defined('TYPO3_MODE') or die();
+
+// Register default link handlers
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('
+    TCEMAIN.linkHandler {
+        page {
+            handler = TYPO3\\CMS\\Recordlist\\LinkHandler\\PageLinkHandler
+            label = LLL:EXT:lang/Resources/Private/Language/locallang_browse_links.xlf:page
+        }
+        file {
+            handler = TYPO3\\CMS\\Recordlist\\LinkHandler\\FileLinkHandler
+            label = LLL:EXT:lang/Resources/Private/Language/locallang_browse_links.xlf:file
+            displayAfter = page
+            scanAfter = page
+        }
+        folder {
+            handler = TYPO3\\CMS\\Recordlist\\LinkHandler\\FolderLinkHandler
+            label = LLL:EXT:lang/Resources/Private/Language/locallang_browse_links.xlf:folder
+            displayAfter = file
+            scanAfter = file
+        }
+        url {
+            handler = TYPO3\\CMS\\Recordlist\\LinkHandler\\UrlLinkHandler
+            label = LLL:EXT:lang/Resources/Private/Language/locallang_browse_links.xlf:extUrl
+            displayAfter = folder
+            scanAfter = mail
+        }
+        mail {
+            handler = TYPO3\\CMS\\Recordlist\\LinkHandler\\MailLinkHandler
+            label = LLL:EXT:lang/Resources/Private/Language/locallang_browse_links.xlf:email
+            displayAfter = url
+        }
+    }
+');
index 927463f..204159a 100644 (file)
@@ -20,37 +20,4 @@ if (TYPO3_MODE === 'BE') {
     $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ElementBrowsers']['db'] =  \TYPO3\CMS\Recordlist\Browser\DatabaseBrowser::class;
     $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ElementBrowsers']['file'] =  \TYPO3\CMS\Recordlist\Browser\FileBrowser::class;
     $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ElementBrowsers']['folder'] =  \TYPO3\CMS\Recordlist\Browser\FolderBrowser::class;
-
-    // register default link handlers
-    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('
-               TCEMAIN.linkHandler {
-                       page {
-                               handler = TYPO3\\CMS\\Recordlist\\LinkHandler\\PageLinkHandler
-                               label = LLL:EXT:lang/Resources/Private/Language/locallang_browse_links.xlf:page
-                       }
-                       file {
-                               handler = TYPO3\\CMS\\Recordlist\\LinkHandler\\FileLinkHandler
-                               label = LLL:EXT:lang/Resources/Private/Language/locallang_browse_links.xlf:file
-                               displayAfter = page
-                               scanAfter = page
-                       }
-                       folder {
-                               handler = TYPO3\\CMS\\Recordlist\\LinkHandler\\FolderLinkHandler
-                               label = LLL:EXT:lang/Resources/Private/Language/locallang_browse_links.xlf:folder
-                               displayAfter = file
-                               scanAfter = file
-                       }
-                       url {
-                               handler = TYPO3\\CMS\\Recordlist\\LinkHandler\\UrlLinkHandler
-                               label = LLL:EXT:lang/Resources/Private/Language/locallang_browse_links.xlf:extUrl
-                               displayAfter = folder
-                               scanAfter = mail
-                       }
-                       mail {
-                               handler = TYPO3\\CMS\\Recordlist\\LinkHandler\\MailLinkHandler
-                               label = LLL:EXT:lang/Resources/Private/Language/locallang_browse_links.xlf:email
-                               displayAfter = url
-                       }
-               }
-       ');
 }