[BUGFIX] Slider Wizard value not set when used in a flexform
authorWouter Wolters <typo3@wouterwolters.nl>
Tue, 27 Mar 2012 17:19:57 +0000 (19:19 +0200)
committerTolleiv Nietsch <tolleiv.nietsch@typo3.org>
Sun, 6 May 2012 20:00:00 +0000 (22:00 +0200)
When the Slider Wizard is used in a flexform the value is given
as XML, which is not handled correctly. When the Slider is used in
a flexform, retrieve the value with t3lib_flexformtools.

Change-Id: Ifeb9f29fe356d062f027f7fba32f912d66743e24
Fixes: #34012
Releases: 4.5,4.6,4.7,6.0
Reviewed-on: http://review.typo3.org/9932
Reviewed-by: Claus Due
Reviewed-by: Arjen Hoekema
Tested-by: Arjen Hoekema
Reviewed-by: Tolleiv Nietsch
Tested-by: Tolleiv Nietsch
t3lib/tceforms/class.t3lib_tceforms_valueslider.php

index 541b009..3155d6e 100644 (file)
@@ -47,6 +47,17 @@ class t3lib_TCEforms_ValueSlider {
 
                $field = $params['field'];
                $value = $params['row'][$field];
+
+                       // If Slider is used in a flexform
+               if (!empty($params['flexFormPath'])) {
+                       $flexFormTools = t3lib_div::makeInstance('t3lib_flexformtools');
+                       $flexFormValue = $flexFormTools->getArrayValueByPath($params['flexFormPath'], t3lib_div::xml2array($value));
+
+                       if ($flexFormValue !== NULL) {
+                               $value = $flexFormValue;
+                       }
+               }
+
                $itemName = $params['itemName'];
                        // Set default values (which correspond to those of the JS component)
                $min = 0;
@@ -105,4 +116,4 @@ class t3lib_TCEforms_ValueSlider {
        }
 }
 
-?>
\ No newline at end of file
+?>