Project

General

Profile

Actions

Bug #66535

closed

Property _localizedUid is not set correctly

Added by Uwe Kammerer over 9 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2015-04-22
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
5.6
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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
Actions #1

Updated by Alexander Opitz over 9 years ago

  • Target version changed from 6.2.12 to 6.2.14
Actions #2

Updated by Alexander Opitz over 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
Actions #3

Updated by Gerrit Code Review over 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

Actions #4

Updated by Gerrit Code Review about 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

Actions #5

Updated by Christian Schmitt about 9 years ago

Could you change that as well in the TYPO3 7.4 Version ?

Thanks
Christian

Actions #6

Updated by Alexander Opitz about 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.

Actions #7

Updated by Alexander Opitz about 9 years ago

  • Target version changed from 6.2.15 to 6.2.16
Actions #8

Updated by Nicole Cordes about 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?

Actions #9

Updated by Gerrit Code Review almost 8 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

Actions #10

Updated by Alexander Opitz about 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?

Actions #11

Updated by Alexander Opitz about 7 years ago

  • Assignee deleted (Alexander Opitz)
Actions #12

Updated by Gerrit Code Review about 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

Actions #13

Updated by Gerrit Code Review about 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

Actions #14

Updated by Stefan Froemken about 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.

Actions #15

Updated by Gerrit Code Review about 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

Actions #16

Updated by Stefan Froemken about 7 years ago

  • File deleted (sfcategory_1.0.0_201710121630.zip)
Actions #17

Updated by Stefan Froemken about 7 years ago

I have uploaded a new version of sfcategory. Now you can test with translated relations, too.

Actions #18

Updated by Gerrit Code Review about 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

Actions #19

Updated by Gerrit Code Review about 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

Actions #20

Updated by Alexander Opitz about 7 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #21

Updated by Helmut Hummel about 7 years ago

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.

Actions #22

Updated by Helmut Hummel about 7 years ago

I'd close this one here as "no bug" if I'm not completely mistaken.

Actions #23

Updated by Markus Klein about 7 years ago

Patches are reverted with https://review.typo3.org/54551

Actions #24

Updated by Riccardo De Contardi almost 7 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.

Actions

Also available in: Atom PDF