[BUGFIX] Correctly evaluate PageTS in TemplateModule 53/64553/2
authorHelmut Hummel <typo3@helhum.io>
Tue, 19 May 2020 21:13:13 +0000 (23:13 +0200)
committerHelmut Hummel <typo3@helhum.io>
Wed, 20 May 2020 08:41:02 +0000 (10:41 +0200)
Set the current page id early, so that PageTS is fetched
from the correct page instead of id 0.

Releases: 9.5, master
Resolves: #91445
Change-Id: I95a50b6c9d45be54291f27828d9f35cb62b3b4dd
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64553
Reviewed-by: Daniel Siepmann <coding@daniel-siepmann.de>
Reviewed-by: Thomas Hohn
Reviewed-by: Benni Mack <benni@typo3.org>
Reviewed-by: Helmut Hummel <typo3@helhum.io>
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Benni Mack <benni@typo3.org>
Tested-by: Helmut Hummel <typo3@helhum.io>
typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateModuleController.php

index 3e8a4d1..7d09a4b 100644 (file)
@@ -192,11 +192,11 @@ class TypoScriptTemplateModuleController
     public function mainAction(ServerRequestInterface $request): ResponseInterface
     {
         $this->request = $request;
+        $this->id = (int)($request->getParsedBody()['id'] ?? $request->getQueryParams()['id'] ?? 0);
         $changedMenuSettings = $request->getParsedBody()['SET'] ?? $request->getQueryParams()['SET'] ?? [];
         $this->menuConfig($changedMenuSettings);
         // Loads $this->extClassConf with the configuration for the CURRENT function of the menu.
         $this->extClassConf = $this->getExternalItemConfig('web_ts', 'function', $this->MOD_SETTINGS['function']);
-        $this->id = (int)($request->getParsedBody()['id'] ?? $request->getQueryParams()['id'] ?? 0);
         $this->perms_clause = $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW);
 
         // Checking for first level external objects