Bug #66535
closedProperty _localizedUid is not set correctly
Added by Uwe Kammerer over 9 years ago. Updated over 6 years ago.
0%
Description
If I set the _localizedUid Property inside my Model to aime to an translated Record, the origin Record gets overwriten. The Problem is caused in the Class TYPO3\CMS\Extbase\Persistence\Generic\Backend in Line 856.
There is the Property set to the current Record UID, so the Object is overwriten.
original Code (Lines 855 - 857):
if ($object->_getProperty('_localizedUid') !== NULL) {
$row['uid'] = $object->_getProperty('_localizedUid');
}
should be changed to:
if ($object->_getProperty('_localizedUid') !== NULL && $dataMap->getTranslationOriginColumnName() !== NULL) {
$row[$dataMap->getTranslationOriginColumnName()] = $object->_getProperty('_localizedUid');
}
after that Change everything works as expected.
Files
sfcategory_1.0.0_201710121908.zip (34.4 KB) sfcategory_1.0.0_201710121908.zip | Stefan Froemken, 2017-10-12 19:09 | ||
sfcategory_fixed.zip (78.5 KB) sfcategory_fixed.zip | Helmut Hummel, 2017-11-04 02:31 |
Updated by Alexander Opitz about 9 years ago
- Target version changed from 6.2.12 to 6.2.14
Updated by Alexander Opitz about 9 years ago
- Status changed from New to In Progress
- Assignee set to Alexander Opitz
- Target version changed from 6.2.14 to 6.2.15
Updated by Gerrit Code Review about 9 years ago
- Status changed from In Progress 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/40951
Updated by Gerrit Code Review almost 9 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/40951
Updated by Christian Schmitt almost 9 years ago
Could you change that as well in the TYPO3 7.4 Version ?
Thanks
Christian
Updated by Alexander Opitz almost 9 years ago
There won't be a new release for 7.4. It only may come to 7.5 and 6.2.x.
You only can help to bring this into master (so for 7.5) if you vote on Gerrit if the patch works.
Updated by Alexander Opitz almost 9 years ago
- Target version changed from 6.2.15 to 6.2.16
Updated by Nicole Cordes almost 9 years ago
The currently provided patch prevents translated records from being updated as the uid isn't fetch from the _localizedUid anymore. TBH I didn't get your use case, so can you please explain what you want to archive with setting the _localizedUid in your Modal?
Updated by Gerrit Code Review over 7 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/40951
Updated by Alexander Opitz almost 7 years ago
- Status changed from Under Review to Needs Feedback
- Target version deleted (
6.2.16)
I abandoned my patch as it is bitrotting around.
So @Uwe Kammerer, does this issue persists or ist it fixed in newer versions of TYPO3?
Updated by Alexander Opitz almost 7 years ago
- Assignee deleted (
Alexander Opitz)
Updated by Gerrit Code Review almost 7 years ago
- Status changed from Needs Feedback 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 https://review.typo3.org/54376
Updated by Gerrit Code Review almost 7 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54376
Updated by Stefan Froemken almost 7 years ago
- File sfcategory_1.0.0_201710121630.zip added
- TYPO3 Version changed from 6.2 to 8
- PHP Version set to 5.6
I have added a little test extension for that issue.
Install as normal
Add new page
Add de translation for that page
Create storage folder
Add TS-Template
Add Storage PID in Constants
Add a language switch in TS: sys_language_uid = 0 (en). 1 = de
Add plugin to page and also an translated page
Open FE in en language
Click create english car
A new "Car" will be created
Click create english car
The just created "Car" was renamed to "Auto" <-- this is the problem
Install my patch and a new record as translation for Car will be created
And my patch also works while editing these records in FE. Try it.
Updated by Gerrit Code Review almost 7 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54376
Updated by Stefan Froemken almost 7 years ago
- File deleted (
sfcategory_1.0.0_201710121630.zip)
Updated by Stefan Froemken almost 7 years ago
I have uploaded a new version of sfcategory. Now you can test with translated relations, too.
Updated by Gerrit Code Review almost 7 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54376
Updated by Gerrit Code Review almost 7 years ago
Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54518
Updated by Alexander Opitz almost 7 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 68e8530319faea18fbc61eee55fc00298582e8de.
Updated by Helmut Hummel almost 7 years ago
- File sfcategory_fixed.zip sfcategory_fixed.zip added
- Status changed from Resolved to Needs Feedback
- % Done changed from 100 to 0
- Complexity deleted (
easy)
Please note, that _localizedUid property is NOT equivalent with l10n_parent. It is meant to hold the uid of the translated record, not the uid of the translation parent.
Therefore setting this property for new domain objects, does not make any sense as it does not exist yet.
I uploaded a slightly modified version of the extension which should work without any core change, as it correctly sets l10n_parent before persisting the translated object.
Updated by Helmut Hummel almost 7 years ago
I'd close this one here as "no bug" if I'm not completely mistaken.
Updated by Markus Klein almost 7 years ago
Patches are reverted with https://review.typo3.org/54551
Updated by Riccardo De Contardi over 6 years ago
- Status changed from Needs Feedback to Closed
No feedback since the last 90 days => closing this issue.
If you think that this is the wrong decision or experience the issue again and have more information about how to reproduce your problem, please reopen it or open a new issue with a reference to this one. Thank you.