[BUGFIX] RTE not loading if multiple content elements are opened 97/40197/2
authorFrank Nägler <typo3@naegler.net>
Thu, 11 Jun 2015 17:44:58 +0000 (19:44 +0200)
committerNicole Cordes <typo3@cordes.co>
Fri, 12 Jun 2015 08:24:42 +0000 (10:24 +0200)
This patch fixes a bug when multiple content elements are processed
at once. This happens if the edit link in page module is used to open
all elements of one column at once.

Resolves: #67400
Releases: master
Change-Id: I605cedaff8f03947363bda002ab23235693dfc50
Reviewed-on: http://review.typo3.org/40197
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
typo3/sysext/backend/Classes/Form/FormEngine.php

index 4164f17..6a0e84d 100644 (file)
@@ -307,16 +307,7 @@ class FormEngine {
                $resultArray = $this->nodeFactory->create($options)->render();
 
                $content = $resultArray['html'];
-               $this->requiredElements = $resultArray['requiredElements'];
-               $this->requiredFields = $resultArray['requiredFields'];
-               $this->requiredAdditional = $resultArray['requiredAdditional'];
-               $this->requiredNested = $resultArray['requiredNested'];
-               $this->additionalJS_post = $resultArray['additionalJavaScriptPost'];
-               $this->additionalJS_submit = $resultArray['additionalJavaScriptSubmit'];
-               $this->extJSCODE = $resultArray['extJSCODE'];
-               $this->inlineData = $resultArray['inlineData'];
-               $this->hiddenFieldAccum = $resultArray['additionalHiddenFields'];
-               $this->additionalCode_pre = $resultArray['additionalHeadTags'];
+               $this->mergeResult($resultArray);
 
                // Hook: getMainFields_postProcess
                foreach ($this->hookObjectsMainFields as $hookObj) {
@@ -386,7 +377,19 @@ class FormEngine {
                $options['renderType'] = 'listOfFieldsContainer';
                $resultArray = $this->nodeFactory->create($options)->render();
                $html = $resultArray['html'];
+               $this->mergeResult($resultArray);
 
+               return $html;
+       }
+
+
+       /**
+        * Merge existing data with the given result array
+        *
+        * @param array $resultArray Array returned by child
+        * @return void
+        */
+       protected function mergeResult(array $resultArray) {
                foreach ($resultArray['requiredElements'] as $element) {
                        $this->requiredElements[] = $element;
                }
@@ -413,8 +416,6 @@ class FormEngine {
                foreach ($resultArray['additionalHeadTags'] as $element) {
                        $this->additionalCode_pre[] = $element;
                }
-
-               return $html;
        }
 
        /**