Bug #59992
closedPersistence session doesn't take overlays into account
100%
Description
ATM the DataMapper
only allows for mapping one record per UID but not additional instances like localized records (e.g. as built by record overlay).
These have the same UID value but their own UID in a separate field (_LOCALIZED_UID). This should be taken into account to allow for mapping localized records in a single session (e.g. for importing data including translations).
Files
Updated by Gerrit Code Review almost 10 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35163
Updated by Gerrit Code Review almost 10 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35163
Updated by Mathias Schreiber almost 10 years ago
- Target version changed from 7.0 to 7.1 (Cleanup)
Updated by Benni Mack over 9 years ago
- Target version changed from 7.1 (Cleanup) to 7.4 (Backend)
Updated by Mathias Brodala over 9 years ago
This one can be closed as WONTFIX or put on hold, see the linked change.
Updated by Marc Bastian Heinrichs over 9 years ago
- Tracker changed from Feature to Bug
- Subject changed from Allow for mapping localized records in a single session to Persistence session doesn't take overlays into account
- Description updated (diff)
- Status changed from Under Review to Accepted
- TYPO3 Version set to 6.2
- Is Regression set to No
I would say, that is a bug and needs to be tackled. For sure in a different way like in the abandoned patch.
Updated by Daniel Siepmann over 9 years ago
Even using the workaround will still use the same uid
for both objects. Saying that, it can create issues while updating the translated record ...
Fixed that for myself by overwriting the getUid()
to return _localizedUid
if set.:
public function getUid() { if($this->_localizedUid > 0) { return (int) $this->_localizedUid; } return parent::getUid(); }
The workaround is to unregister the entity from the persistence session:persistenceSession->unregisterObject($entity);
where you have to instantiate the persistence Session \TYPO3\CMS\Extbase\Persistence\Generic\Session
first via inject or ObjectManager
. E.g. inside of your Repository.
Updated by Susanne Moog over 9 years ago
- Target version changed from 7.4 (Backend) to 7.5
Updated by Tymoteusz Motylewski about 6 years ago
- TYPO3 Version changed from 6.2 to 9
- PHP Version deleted (
5.3)
The issue does still exist in v9.
having query like (where post:2 is in lang 0 and post:11 is translation of post:2)
$query = $this->postRepository->createQuery(); $querySettings = $query->getQuerySettings(); $querySettings->setLanguageUid(0); $querySettings->setStoragePageIds([20]); $query->matching($query->equals('uid', 2)); $post2 = $query->execute()->getFirst();
and then query like:
$query = $this->postRepository->createQuery(); $querySettings = $query->getQuerySettings(); $querySettings->setLanguageUid(1); $querySettings->setStoragePageIds([20]); $query->matching($query->equals('uid', 11)); $post2 = $query->execute()->getFirst();
You'll get different results depending which query is run first.
or whether you run stuff like
$this->persistenceManager->clearState();
between queries.
In order to get this thing fixed and avoid breaking other things I see following path:
1) extend existing test suite with tests covering translated records and/or rendering of the translated page
- test for building links pointing to an extbase record (when viewing a page with L=1, checking objects with and without translation parent)
- test for form _identity rendering (creating/editing records)
- test for calling findByUid(2) and then findByUid(11) with and without clearing session between calls (while being in the L=1)
2) try to introduce better cache identifier for persistance session
Updated by Tymoteusz Motylewski about 6 years ago
- Related to Bug #45873: querySettings setRespectSysLanguage or setSysLanguageUid does not work added
Updated by Tymoteusz Motylewski about 6 years ago
- Has duplicate Bug #81126: After $querySettings()->setLanguageUid(1); it doesn't change. added
Updated by Tymoteusz Motylewski about 6 years ago
- Related to Bug #86405: querySetting setRespectSysLanguage (wrong implementation of "strict"-mode) added
Updated by Gerrit Code Review over 2 years ago
- Status changed from Accepted to Under Review
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/75099
Updated by Gerrit Code Review over 2 years ago
Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/75099
Updated by Gerrit Code Review over 2 years ago
Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/75099
Updated by Gerrit Code Review over 2 years ago
Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/75099
Updated by Benni Mack over 2 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset f1552ad4a1e08961d672200710490c4ada9d8a60.
Updated by Garvin Hicking about 1 month ago
- Related to Bug #105319: Extbase domain model combined identity for localized entries added