Project

General

Profile

Actions

Bug #81915

closed

Website content is deleted when trying to translate a record that contains a field (type=inline) with foreign_table=tt_content and no MM table but foreign_field instead

Added by Negru Horea almost 7 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Localization
Target version:
-
Start date:
2017-07-19
Due date:
% Done:

100%

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

Description

The issue was discovered using News Extension (news) Version 6.0.0
Background/steps to reproduce:
- basic installation of the latest Typo3 8 version (8.7.3).
- some pages with any content
- add some website languages
- a news directory page with alternative page languages
- add a news item and in the Content Elements tab add some records
- when trying to translate the news ,almost all the content elements from the pages gets deleted

Reason: when trying to synchronize the translated record the following trace is made:

TYPO3\\CMS\\Core\\DataHandling\\DataHandler->localize()
TYPO3\\CMS\\Core\\DataHandling\\DataHandler->copyRecord()
TYPO3\\CMS\\Core\\DataHandling\\DataHandler->process_datamap()
TYPO3\\CMS\\Core\\DataHandling\\Localization\\DataMapProcessor->process()
TYPO3\\CMS\\Core\\DataHandling\\Localization\\DataMapProcessor->enrich()
TYPO3\\CMS\\Core\\DataHandling\\Localization\\DataMapProcessor->synchronizeTranslationItem()
TYPO3\\CMS\\Core\\DataHandling\\Localization\\DataMapProcessor->synchronizeFieldValues()
TYPO3\\CMS\\Core\\DataHandling\\Localization\\DataMapProcessor->synchronizeInlineRelations()

Here (synchronizeInlineRelations()) the class TYPO3\CMS\Core\Database\*RelationHandler* is used to retrieve the news related content elements

In the method TYPO3\CMS\Core\Database\RelationHandler->readForeignField($uid,$conf) which is called at some point the uid is casted to integer.
The issue is that the translation record $uid is a string like "NEW596e1c7328818477389929" and it will be casted to 0.
The query will then return all the records from the tt_content table (all that have value 0 in the foreign_field field - "tx_news_related_news" ).

Returning to the synchronizeInlineRelations() method, the array $removeIds will contain the ids of tt_content elements that are not related to the news record and will get deleted.

Actions #1

Updated by Negru Horea almost 7 years ago

  • Subject changed from Website content is deleted when trying to translate a record that contains a field (type=inline) with foreign_table=tt_content and no MN table but foreign_field instead to Website content is deleted when trying to translate a record that contains a field (type=inline) with foreign_table=tt_content and no MM table but foreign_field instead
Actions #2

Updated by Gerrit Code Review almost 7 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 https://review.typo3.org/53544

Actions #3

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/53544

Actions #4

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/53544

Actions #5

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/53581

Actions #6

Updated by Oliver Hader almost 7 years ago

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

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF