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

ChangeLog
t3lib/class.t3lib_tceforms_inline.php

index f05bc81..f664232 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2007-11-07  Oliver Hader  <oh@inpublica.de>
 
        * Fixed bug #5772: IRRE - Combination mode doesn't save new child records correctly
+       * Fixed bug #6456: IRRE - Palettes are not rendered correctly on nesting records using the same table
 
 2007-11-02  Ingmar Schlecht  <ingmar@typo3.org>
 
index 9f2db69..45da664 100755 (executable)
@@ -319,7 +319,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) {
@@ -356,6 +356,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
+        */
+       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.
         *
@@ -594,7 +618,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