Revert "[BUGFIX] Set _localizedUid in OriginColumnName" 52/54552/3
authorHelmut Hummel <typo3@helhum.io>
Sat, 4 Nov 2017 00:59:53 +0000 (02:59 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Sat, 4 Nov 2017 18:45:25 +0000 (19:45 +0100)
This reverts commit 3d03fc2891331593ee348944bfbe3ccc34bb9f5f.

The patch needs to be reverted due to wrong implementation.
The desired goal is not achievable at all with the current code base.

Reverts: #66535
Releases: master, 8.7
Change-Id: Ia26ff7abf96f77ab4b9de7e7de0e442fc2c83bf8
Reviewed-on: https://review.typo3.org/54552
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php
typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapper.php

index 64b051d..c703602 100644 (file)
@@ -762,7 +762,7 @@ class Backend implements \TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface
         $dataMap = $this->dataMapper->getDataMap(get_class($parentObject));
         $columnMap = $dataMap->getColumnMap($propertyName);
         $parentUid = $parentObject->getUid();
-        if (!empty($parentObject->_getProperty('_localizedUid'))) {
+        if ($parentObject->_getProperty('_localizedUid') !== null) {
             $parentUid = $parentObject->_getProperty('_localizedUid');
         }
         $row = [
@@ -934,7 +934,7 @@ class Backend implements \TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface
         $row['uid'] = $object->getUid();
         if ($dataMap->getLanguageIdColumnName() !== null) {
             $row[$dataMap->getLanguageIdColumnName()] = (int)$object->_getProperty('_languageUid');
-            if (!empty($object->_getProperty('_localizedUid'))) {
+            if ($object->_getProperty('_localizedUid') !== null) {
                 $row['uid'] = $object->_getProperty('_localizedUid');
             }
         }
index f7a285b..4adb5be 100644 (file)
@@ -233,7 +233,7 @@ class DataMapper implements \TYPO3\CMS\Core\SingletonInterface
         $dataMap = $this->getDataMap($className);
         $object->_setProperty('uid', (int)$row['uid']);
         $object->_setProperty('pid', (int)$row['pid']);
-        $object->_setProperty('_localizedUid', (int)$row[$dataMap->getTranslationOriginColumnName()]);
+        $object->_setProperty('_localizedUid', (int)$row['uid']);
         $object->_setProperty('_versionedUid', (int)$row['uid']);
         if ($dataMap->getLanguageIdColumnName() !== null) {
             $object->_setProperty('_languageUid', (int)$row[$dataMap->getLanguageIdColumnName()]);