[BUGFIX] Fix override field handling in form engine 57/39157/4
authorHelmut Hummel <helmut.hummel@typo3.org>
Fri, 1 May 2015 14:33:24 +0000 (16:33 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Fri, 1 May 2015 18:35:42 +0000 (20:35 +0200)
The override field handling was broken since the form engine
refactoring. This change applies several fixes
to make it work again.

Resolves: #66705
Releases: master
Change-Id: I7cd83952d130a7a1e875b75bcd093bf51a9904d6
Reviewed-on: http://review.typo3.org/39157
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/backend/Classes/Form/AbstractNode.php
typo3/sysext/backend/Classes/Form/Container/PaletteAndSingleContainer.php
typo3/sysext/backend/Classes/Form/Container/SingleFieldContainer.php

index 826f4e0..975a698 100644 (file)
@@ -102,6 +102,12 @@ abstract class AbstractNode {
                foreach ($childReturn['additionalJavaScriptSubmit'] as $value) {
                        $existing['additionalJavaScriptSubmit'][] = $value;
                }
+               foreach ($childReturn['additionalHiddenFields'] as $value) {
+                       $existing['additionalHiddenFields'][] = $value;
+               }
+               foreach ($childReturn['additionalHeadTags'] as $value) {
+                       $existing['additionalHeadTags'][] = $value;
+               }
                if (!empty($childReturn['inlineData'])) {
                        $existingInlineData = $existing['inlineData'];
                        $childInlineData = $childReturn['inlineData'];
index d09c408..335b41e 100644 (file)
@@ -275,6 +275,8 @@ class PaletteAndSingleContainer extends AbstractContainer {
                                        );
                                        $singleFieldContentArray['html'] = '';
                                        $this->resultArray = $this->mergeChildReturnIntoExistingResult($this->resultArray, $singleFieldContentArray);
+                               } else {
+                                       $this->resultArray = $this->mergeChildReturnIntoExistingResult($this->resultArray, $singleFieldContentArray);
                                }
                        }
                }
index c43f76a..4507742 100644 (file)
@@ -136,7 +136,7 @@ class SingleFieldContainer extends AbstractContainer {
                        // @todo: This is an ugly concept ... search for overrideVals and defVals for a full picture of this madness
                        $resultArray = $this->initializeResultArray();
                        // This hidden field can not just be returned as casual html since upper containers will then render a label and wrapping stuff - this is not wanted here
-                       $resultArray['additionalHiddenFields'] = '<input type="hidden" name="' . $parameterArray['itemFormElName'] . '" value="' . htmlspecialchars($parameterArray['itemFormElValue']) . '" />';
+                       $resultArray['additionalHiddenFields'][] = '<input type="hidden" name="' . $parameterArray['itemFormElName'] . '" value="' . htmlspecialchars($parameterArray['itemFormElValue']) . '" />';
                } else {
                        // JavaScript code for event handlers:
                        $parameterArray['fieldChangeFunc'] = array();