[+TASK] Extbase: Fixed regression introduced in the last commit. The uid of updated...
authorJochen Rau <j.rau@web.de>
Thu, 15 Apr 2010 08:00:23 +0000 (08:00 +0000)
committerJochen Rau <j.rau@web.de>
Thu, 15 Apr 2010 08:00:23 +0000 (08:00 +0000)
typo3/sysext/extbase/Classes/Persistence/Backend.php
typo3/sysext/extbase/Classes/Persistence/Mapper/DataMapper.php

index 3fc3a48..a550255 100644 (file)
@@ -784,12 +784,12 @@ class Tx_Extbase_Persistence_Backend implements Tx_Extbase_Persistence_BackendIn
        protected function updateObject(Tx_Extbase_DomainObject_DomainObjectInterface $object, array $row) {
                $dataMap = $this->dataMapper->getDataMap(get_class($object));
                $this->addCommonFieldsToRow($object, $row);
+               $row['uid'] = $object->getUid();
                if($dataMap->getLanguageIdColumnName() !== NULL) {
                        $row[$dataMap->getLanguageIdColumnName()] = $object->_getProperty('_languageUid');
-                       $row['uid'] = $object->_getProperty('_localizedUid');
-                       // $row[$dataMap->getTranslationOriginColumnName()] = $object->_getProperty('_languageUid');
-               } else {
-                       $row['uid'] = $object->getUid();
+                       if ($object->_getProperty('_localizedUid') !== NULL) {
+                               $row['uid'] = $object->_getProperty('_localizedUid');
+                       }
                }
                $res = $this->storageBackend->updateRow(
                        $dataMap->getTableName(),
index 9f5f4dc..439d1c5 100644 (file)
@@ -195,8 +195,6 @@ class Tx_Extbase_Persistence_Mapper_DataMapper implements t3lib_Singleton {
                        $object->_setProperty('_languageUid', intval($row[$dataMap->getLanguageIdColumnName()]));
                        if (isset($row['_LOCALIZED_UID'])) {
                                $object->_setProperty('_localizedUid', intval($row['_LOCALIZED_UID']));
-                       } else {
-                               $object->_setProperty('_localizedUid', intval($row['uid']));
                        }
                }
                $properties = $object->_getProperties();