diff --git a/typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapper.php b/typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapper.php index 1bde9db..131cae8 100644 --- a/typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapper.php +++ b/typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapper.php @@ -133,11 +133,14 @@ class DataMapper implements \TYPO3\CMS\Core\SingletonInterface { * @return object An object of the given class */ protected function mapSingleRow($className, array $row) { - if ($this->identityMap->hasIdentifier($row['uid'], $className)) { - $object = $this->identityMap->getObjectByIdentifier($row['uid'], $className); + // Take localized UID into account to allow for mapping + // original records and translations in a single session + $uid = isset($row['_LOCALIZED_UID']) ? $row['_LOCALIZED_UID'] : $row['uid']; + if ($this->identityMap->hasIdentifier($uid, $className)) { + $object = $this->identityMap->getObjectByIdentifier($uid, $className); } else { $object = $this->createEmptyObject($className); - $this->identityMap->registerObject($object, $row['uid']); + $this->identityMap->registerObject($object, $uid); $this->thawProperties($object, $row); $object->_memorizeCleanState(); $this->persistenceSession->registerReconstitutedEntity($object);