[+BUGFIX] Extbase (Persistence): For MM_match_fields the fieldname got prefixed twice...
authorJochen Rau <j.rau@web.de>
Tue, 16 Mar 2010 08:32:35 +0000 (08:32 +0000)
committerJochen Rau <j.rau@web.de>
Tue, 16 Mar 2010 08:32:35 +0000 (08:32 +0000)
typo3/sysext/extbase/Classes/Persistence/Mapper/DataMapper.php

index 2007c64..cd03fe3 100644 (file)
@@ -334,14 +334,12 @@ class Tx_Extbase_Persistence_Mapper_DataMapper implements t3lib_Singleton {
                                $query->setOrderings(array($childSortByFieldName => Tx_Extbase_Persistence_QueryInterface::ORDER_ASCENDING));
                        }
                        
-                       // attempt to support MM_match_fields
                        $conditions = $query->equals($parentKeyFieldName, $parentObject->getUid());
 
                        $relationTableMatchFields = $columnMap->getRelationTableMatchFields();
                        if (count($relationTableMatchFields)) {
                                foreach($relationTableMatchFields as $relationTableMatchFieldName => $relationTableMatchFieldValue) {
-                                       $relationMatchCondition = $query->equals($relationTableName . '.' . $relationTableMatchFieldName, $relationTableMatchFieldValue);
-                                       $conditions = $query->logicalAnd($conditions, $relationMatchCondition);
+                                       $conditions = $query->logicalAnd($conditions, $query->equals($relationTableMatchFieldName, $relationTableMatchFieldValue));
                                }
                        }
                        $query->matching($conditions);