[BUGFIX] displayCondition on FlexForm Sheets broken
authorSteffen Ritter <info@rs-websystems.de>
Sat, 31 Mar 2012 13:53:13 +0000 (15:53 +0200)
committerSteffen Ritter <info@rs-websystems.de>
Wed, 11 Apr 2012 11:22:05 +0000 (13:22 +0200)
Due to the usage of an undefined variable, the value of
an field within the flexform cannot resolved correctly.
As an result any displayCondition of an FlexForm sheet looking
at a field value (FIELD:*:=:value) evaluates to false.

Change-Id: I31bf3af8b61981d7fde9e3d0f1c6dbc01118d14a
Fixes: #35436
Releases: 6.0,4.7
Reviewed-on: http://review.typo3.org/10107
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
Reviewed-by: Dominik Mathern
Tested-by: Dominik Mathern
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
Reviewed-on: http://review.typo3.org/10221

t3lib/class.t3lib_tceforms.php

index 60ebbf8..c46ef0c 100644 (file)
@@ -2516,6 +2516,7 @@ class t3lib_TCEforms {
                                if (!$langChildren && !$langDisabled) {
                                        $item .= '<strong>' . $this->getLanguageIcon($table, $row, 'v' . $lKey) . $lKey . ':</strong>';
                                }
+                               $lang = 'l' . $lKey; // Default language, other options are "lUK" or whatever country code (independant of system!!!)
 
                                $tabParts = array();
                                foreach ($tabsToTraverse as $sheet) {
@@ -2525,6 +2526,7 @@ class t3lib_TCEforms {
                                        if ($dataStruct['ROOT']['TCEforms']['displayCond']) {
                                                $splittedCondition = t3lib_div::trimExplode(':', $dataStruct['ROOT']['TCEforms']['displayCond']);
                                                $skipCondition = FALSE;
+                                               $fakeRow = array();
                                                switch ($splittedCondition[0]) {
                                                        case 'FIELD':
                                                                list($sheetName, $fieldName) = t3lib_div::trimExplode('.', $splittedCondition[1]);
@@ -2555,7 +2557,6 @@ class t3lib_TCEforms {
 
                                                // Render sheet:
                                        if (is_array($dataStruct['ROOT']) && is_array($dataStruct['ROOT']['el'])) {
-                                               $lang = 'l' . $lKey; // Default language, other options are "lUK" or whatever country code (independant of system!!!)
                                                $PA['_valLang'] = $langChildren && !$langDisabled ? $editData['meta']['currentLangId'] : 'DEF'; // Default language, other options are "lUK" or whatever country code (independant of system!!!)
                                                $PA['_lang'] = $lang;
                                                        // Assemble key for loading the correct CSH file