Fixed bug #6456: IRRE - Palettes are not rendered correctly on nesting records using...
authorOliver Hader <oliver.hader@typo3.org>
Wed, 7 Nov 2007 07:30:50 +0000 (07:30 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Wed, 7 Nov 2007 07:30:50 +0000 (07:30 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2672 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_tceforms_inline.php

index 3b81f68..a9ce6c1 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2007-11-07  Oliver Hader  <oh@inpublica.de>
 
        * (major) Fixed bug #5772: IRRE - Combination mode doesn't save new child records correctly
+       * (minor) Fixed bug #6456: IRRE - Palettes are not rendered correctly on nesting records using the same table
 
 2007-11-06  Stanislas Rolland  <stanislas.rolland@fructifor.ca>
 
index 7fea3b2..bf869f5 100755 (executable)
@@ -325,7 +325,7 @@ class t3lib_TCEforms_inline {
 
                $header = $this->renderForeignRecordHeader($parentUid, $foreign_table, $rec, $config);
                $combination = $this->renderCombinationTable($rec, $appendFormFieldNames, $config);
-               $fields = $this->fObj->getMainFields($foreign_table,$rec);
+               $fields = $this->renderMainFields($foreign_table, $rec);
                $fields = $this->wrapFormsSection($fields);
 
                if ($isNewRecord) {
@@ -362,6 +362,30 @@ class t3lib_TCEforms_inline {
 
 
        /**
+        * Wrapper for TCEforms::getMainFields().
+        *
+        * @param       string          $table: The table name
+        * @param       array           $row: The record to be rendered
+        * @return      string          The rendered form
+        */
+       protected function renderMainFields($table, $row) {
+                       // The current render depth of t3lib_TCEforms:
+               $depth = $this->fObj->renderDepth;
+                       // If there is some information about already rendered palettes of our parent, store this info:
+               if (isset($this->fObj->palettesRendered[$depth][$table])) {
+                       $palettesRendered = $this->fObj->palettesRendered[$depth][$table];
+               }
+                       // Render the form:
+               $content = $this->fObj->getMainFields($table, $row, $depth);
+                       // If there was some info about rendered palettes stored, write it back for our parent:
+               if (isset($palettesRendered)) {
+                       $this->fObj->palettesRendered[$depth][$table] = $palettesRendered;
+               }
+               return $content;
+       }
+
+
+       /**
         * Renders the HTML header for a foreign record, such as the title, toggle-function, drag'n'drop, etc.
         * Later on the command-icons are inserted here.
         *
@@ -604,7 +628,7 @@ class t3lib_TCEforms_inline {
                        }
 
                                // get the TCEforms interpretation of the TCA of the child table
-                       $out = $this->fObj->getMainFields($comboConfig['foreign_table'], $comboRecord);
+                       $out = $this->renderMainFields($comboConfig['foreign_table'], $comboRecord);
                        $out = $this->wrapFormsSection($out, array(), array('class' => 'wrapperAttention'));
 
                                // if this is a new record, add a pid value to store this record and the pointer value for the intermediate table