Fixed bug #8191: IRRE - Storing data crashes somehow with MM tables
authorOliver Hader <oliver.hader@typo3.org>
Sat, 27 Feb 2010 15:19:50 +0000 (15:19 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Sat, 27 Feb 2010 15:19:50 +0000 (15:19 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7067 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_tcemain.php

index d1c1b67..bb5cfdb 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-02-27  Oliver Hader  <oliver@typo3.org>
+
+       * Fixed bug #8191: IRRE - Storing data crashes somehow with MM tables (thanks to Peter Kuehn & Franz Koch)
+
 2010-02-27  Steffen Kamper  <info@sk-typo3.de>
 
        * Fixed bug #7896: Hide the page browser if not enough entries are available (Thanks to Stefan Galinski)
index faeb7a8..d8f8652 100644 (file)
@@ -2496,6 +2496,11 @@ class t3lib_TCEmain      {
                                // update record in intermediate table (sorting & pointer uid to parent record)
                        $dbAnalysis->writeForeignField($tcaFieldConf, $id, 0, $skipSorting);
                        $newValue = ($keepTranslation ? 0 : $dbAnalysis->countItems(false));
+                       // IRRE with MM relation:
+               } else if ($this->getInlineFieldType($tcaFieldConf) == 'mm') {
+                               // in order to fully support all the MM stuff, directly call checkValue_group_select_processDBdata instead of repeating the needed code here
+                       $valueArray = $this->checkValue_group_select_processDBdata($valueArray, $tcaFieldConf, $id, $status, 'select', $table, $field);
+                       $newValue = ($keepTranslation ? 0 : $valueArray[0]);
                        // IRRE with comma separated values:
                } else {
                        $valueArray = $dbAnalysis->getValueArray();
@@ -6645,7 +6650,10 @@ $this->log($table,$id,6,0,0,'Stage raised...',30,array('comment'=>$comment,'stag
         */
        function dbAnalysisStoreExec()  {
                foreach ($this->dbAnalysisStore as $action) {
-                       $id = t3lib_BEfunc::wsMapId($action[4], $this->substNEWwithIDs[$action[2]]);
+                       $id = t3lib_BEfunc::wsMapId(
+                               $action[4],
+                               (t3lib_div::testInt($action[2]) ? $action[2] : $this->substNEWwithIDs[$action[2]])
+                       );
                        if ($id)        {
                                $action[0]->writeMM($action[1], $id, $action[3]);
                        }