diff -ru typo3_src-4.2.5.orig/typo3_src-4.2.5/t3lib/class.t3lib_tcemain.php typo3_src-4.2.5/t3lib/class.t3lib_tcemain.php --- typo3_src-4.2.5.orig/typo3_src-4.2.5/t3lib/class.t3lib_tcemain.php 2009-01-24 17:30:14.000000000 +0100 +++ typo3_src-4.2.5/t3lib/class.t3lib_tcemain.php 2009-01-31 12:50:40.000000000 +0100 @@ -3130,7 +3130,18 @@ // If references are set for this field, set flag so they can be corrected later (in ->remapListedDBRecords()) if ($this->isReferenceField($dsConf) && strlen($dataValue)) { - $this->registerDBList[$table][$uid][$field] = 'FlexForm_reference'; + if($dsConf['MM']){ + $allowedTables = $dsConf['type']=='group' ? $dsConf['allowed'] : $dsConf['foreign_table'].','.$dsConf['neg_foreign_table']; // Allowed tables for references. + $prependName = $dsConf['type']=='group' ? $dsConf['prepend_tname'] : ''; // Table name to prepend the UID + $dontRemapTables = t3lib_div::trimExplode(',',$dsConf['dontRemapTablesOnCopy'],1); // Which tables that should possibly not be remapped + // Convert value to list of references: + $dbAnalysis = t3lib_div::makeInstance('t3lib_loadDBGroup'); + $dbAnalysis->registerNonTableValues = ($dsConf['type']=='select' && $dsConf['allowNonIdValues']) ? 1 : 0; + $dbAnalysis->start($dataValue, $allowedTables, $dsConf['MM'], $uid, $table, $dsConf); + $dataValue=implode(',',$dbAnalysis->getValueArray($prependName)); + }else{ + $this->registerDBList[$table][$uid][$field] = 'FlexForm_reference'; + } } // Return