Bug #59992 ยป datamapper-localizations.patch

Enable mapping of localized records - Mathias Brodala, 2014-06-30 11:31

View differences:

typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapper.php
133 133
	 * @return object An object of the given class
134 134
	 */
135 135
	protected function mapSingleRow($className, array $row) {
136
		if ($this->identityMap->hasIdentifier($row['uid'], $className)) {
137
			$object = $this->identityMap->getObjectByIdentifier($row['uid'], $className);
136
		// Take localized UID into account to allow for mapping
137
		// original records and translations in a single session
138
		$uid = isset($row['_LOCALIZED_UID']) ? $row['_LOCALIZED_UID'] : $row['uid'];
139
		if ($this->identityMap->hasIdentifier($uid, $className)) {
140
			$object = $this->identityMap->getObjectByIdentifier($uid, $className);
138 141
		} else {
139 142
			$object = $this->createEmptyObject($className);
140
			$this->identityMap->registerObject($object, $row['uid']);
143
			$this->identityMap->registerObject($object, $uid);
141 144
			$this->thawProperties($object, $row);
142 145
			$object->_memorizeCleanState();
143 146
			$this->persistenceSession->registerReconstitutedEntity($object);
    (1-1/1)