Skip to content

Commit

Permalink
[DOC] Explain flux parent assignment for translations
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelbrackets committed Jan 3, 2017
1 parent 954654e commit e5d7d02
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Classes/Service/ContentService.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,16 +309,18 @@ protected function initializeRecordByNewAndOldAndLanguageUids(
DataHandler $tceMain
) {
if (0 < $newUid && 0 < $oldUid && 0 < $newLanguageUid) {
// Get the origin record of the current record to find out if it has any
// parameters we need to adapt in the current record.
$oldRecord = $this->loadRecordFromDatabase($oldUid);
if (
$oldRecord[$languageFieldName] !== $newLanguageUid
&& $oldRecord['pid'] === $row['pid']
&& MathUtility::canBeInterpretedAsInteger($oldRecord['tx_flux_parent'])
&& $oldRecord['tx_flux_parent'] > 0
) {
// look for the translated version of the parent record indicated
// in this new, translated record. Below, we adjust the parent UID
// so it has the UID of the translated parent if one exists.
// If the origin record has a flux parent assigned, then look for the
// translated, very last version this parent record and, if any valid record was found,
// assign its UID as flux parent to the current record.
$translatedParents = (array) $this->workspacesAwareRecordService->get(
'tt_content',
'uid,sys_language_uid',
Expand Down

0 comments on commit e5d7d02

Please sign in to comment.