[BUGFIX] Flexform field is available but not passed to sub-function calls 77/21577/2
authorClaus Due <claus@wildside.dk>
Fri, 21 Jun 2013 18:47:45 +0000 (20:47 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Fri, 21 Jun 2013 19:34:41 +0000 (21:34 +0200)
This change fixes three occurrences of calls to FlexForm DS
processing methods which accept a $fieldName argument but in
the current state of the code is given an empty string instead
of the $field variable which exists in all three contexts and
contains the proper value.

Passing the field name along to these sub functions allows hook
subscribers to use the field name - among other things. In any
case this fixes an unexpected behaviour turning it into an
expected one.

Resolves: #49331
Releases: 6.2, 6.1, 6.0, 4.7, 4.5
Change-Id: I078b0734f3bfa74a9acd61773c5c380f091286f8
Reviewed-on: https://review.typo3.org/21577
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/core/Classes/Configuration/FlexForm/FlexFormTools.php
typo3/sysext/core/Classes/DataHandling/DataHandler.php
typo3/sysext/core/Classes/Database/ReferenceIndex.php

index ee7e56f..e06060a 100644 (file)
@@ -111,7 +111,7 @@ class FlexFormTools {
                }
                $this->callBackObj = $callBackObj;
                // Get Data Structure:
-               $dataStructArray = \TYPO3\CMS\Backend\Utility\BackendUtility::getFlexFormDS($GLOBALS['TCA'][$table]['columns'][$field]['config'], $row, $table);
+               $dataStructArray = \TYPO3\CMS\Backend\Utility\BackendUtility::getFlexFormDS($GLOBALS['TCA'][$table]['columns'][$field]['config'], $row, $table, $field);
                // If data structure was ok, proceed:
                if (is_array($dataStructArray)) {
                        // Get flexform XML data:
index 2403550..f723f25 100644 (file)
@@ -1989,7 +1989,7 @@ class DataHandler {
                        // The problem is, that when copying a page, flexfrom XML comes along in the array for the new record - but since $this->checkValue_currentRecord does not have a uid or pid for that sake, the \TYPO3\CMS\Backend\Utility\BackendUtility::getFlexFormDS() function returns no good DS. For new records we do know the expected PID so therefore we send that with this special parameter. Only active when larger than zero.
                        $newRecordPidValue = $status == 'new' ? $realPid : 0;
                        // Get current value array:
-                       $dataStructArray = \TYPO3\CMS\Backend\Utility\BackendUtility::getFlexFormDS($tcaFieldConf, $this->checkValue_currentRecord, $table, '', TRUE, $newRecordPidValue);
+                       $dataStructArray = \TYPO3\CMS\Backend\Utility\BackendUtility::getFlexFormDS($tcaFieldConf, $this->checkValue_currentRecord, $table, $field, TRUE, $newRecordPidValue);
                        $currentValueArray = \TYPO3\CMS\Core\Utility\GeneralUtility::xml2array($curValue);
                        if (!is_array($currentValueArray)) {
                                $currentValueArray = array();
index 53f5fa9..8d7329a 100644 (file)
@@ -370,7 +370,7 @@ class ReferenceIndex {
                                if ($conf['type'] == 'flex') {
                                        // Get current value array:
                                        // NOTICE: failure to resolve Data Structures can lead to integrity problems with the reference index. Please look up the note in the JavaDoc documentation for the function \TYPO3\CMS\Backend\Utility\BackendUtility::getFlexFormDS()
-                                       $dataStructArray = \TYPO3\CMS\Backend\Utility\BackendUtility::getFlexFormDS($conf, $row, $table, '', $this->WSOL);
+                                       $dataStructArray = \TYPO3\CMS\Backend\Utility\BackendUtility::getFlexFormDS($conf, $row, $table, $field, $this->WSOL);
                                        $currentValueArray = \TYPO3\CMS\Core\Utility\GeneralUtility::xml2array($value);
                                        // Traversing the XML structure, processing files:
                                        if (is_array($currentValueArray)) {