[BUGFIX] PAGE_TSCONFIG_ID is not visible in TCA wizards 98/30498/5
authorSteffen Kamper <info@sk-typo3.de>
Sat, 31 May 2014 12:05:08 +0000 (14:05 +0200)
committerXavier Perseguers <xavier@typo3.org>
Wed, 11 Jun 2014 14:35:54 +0000 (16:35 +0200)
The placeholder PAGE_TSCONFIG_ID may be used in a foreign_table_where
TCA condition but is not available as parameter when using a wizard
to create new records. This patch fixes this issue.

Fixes: #59245
Releases: 6.2
Change-Id: I19ae9d72e14c047a08107fe6152093a4b04c27f6
Reviewed-on: https://review.typo3.org/30498
Reviewed-by: Wouter Wolters
Reviewed-by: Marcin SÄ…gol
Reviewed-by: Fabien Udriot
Tested-by: Fabien Udriot
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
typo3/sysext/backend/Classes/Controller/Wizard/AddController.php
typo3/sysext/backend/Classes/Controller/Wizard/ListController.php

index 3c8e7dc..9360771 100644 (file)
@@ -109,8 +109,13 @@ class AddController {
                // Get TSconfig for it.
                $TSconfig = BackendUtility::getTCEFORM_TSconfig($this->P['table'], is_array($origRow) ? $origRow : array('pid' => $this->P['pid']));
                // Set [params][pid]
-               if (substr($this->P['params']['pid'], 0, 3) == '###' && substr($this->P['params']['pid'], -3) == '###') {
-                       $this->pid = (int)$TSconfig['_' . substr($this->P['params']['pid'], 3, -3)];
+               if (substr($this->P['params']['pid'], 0, 3) === '###' && substr($this->P['params']['pid'], -3) === '###') {
+                       $keyword = substr($this->P['params']['pid'], 3, -3);
+                       if (strpos($keyword, 'PAGE_TSCONFIG_') === 0) {
+                               $this->pid = (int)$TSconfig[$this->P['field']][$keyword];
+                       } else {
+                               $this->pid = (int)$TSconfig['_' . $keyword];
+                       }
                } else {
                        $this->pid = (int)$this->P['params']['pid'];
                }
index 1f51751..a2d6310 100644 (file)
@@ -86,8 +86,13 @@ class ListController {
                // Get TSconfig for it.
                $TSconfig = BackendUtility::getTCEFORM_TSconfig($this->table, is_array($origRow) ? $origRow : array('pid' => $this->P['pid']));
                // Set [params][pid]
-               if (substr($this->P['params']['pid'], 0, 3) == '###' && substr($this->P['params']['pid'], -3) == '###') {
-                       $this->pid = (int)$TSconfig['_' . substr($this->P['params']['pid'], 3, -3)];
+               if (substr($this->P['params']['pid'], 0, 3) === '###' && substr($this->P['params']['pid'], -3) === '###') {
+                       $keyword = substr($this->P['params']['pid'], 3, -3);
+                       if (strpos($keyword, 'PAGE_TSCONFIG_') === 0) {
+                               $this->pid = (int)$TSconfig[$this->P['field']][$keyword];
+                       } else {
+                               $this->pid = (int)$TSconfig['_' . $keyword];
+                       }
                } else {
                        $this->pid = (int)$this->P['params']['pid'];
                }