Project

General

Profile

Actions

Bug #67486

closed

[DATALOSE] Datahandler writes wrong workspace pid to live records

Added by Andreas Kießling over 9 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
DataHandler aka TCEmain
Target version:
-
Start date:
2015-06-16
Due date:
% Done:

0%

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

Description

How to reproduce: add a file to the pages media -> The pid points to the live id. Now switch to a workspace and add another file. Since the big IRRE refactoring #56376, all relations should point to the live ids. The new sys_file_reference record does that, but the already existing record now has the uid of the pages record in the workspace! Both relations show up in the workspace and publishing the pages record also works, but the real trouble starts when cleaning up with "lowlevel_cleaner versions". The pages record from the workspace will be deleted because it is published. The records on that versioned page will also be deleted, and thus the sys_file_reference is gone.

How to fix? \TYPO3\CMS\Core\DataHandling\DataHandler::remapListedDBRecords_procInline does an SQL update which writes to the records it processed. Removing these lines prevents the wrong pid, but i have no idea what the intention of these were. But that won't fix the records with invalid pids...

// Update child records if change to pid is required (only if the current record is not on a workspace):
if ($thePidToUpdate) {
    $updateValues = array('pid' => $thePidToUpdate);
    foreach ($originalItemArray as $v) {
        if ($v['id'] && $v['table'] && is_null(BackendUtility::getLiveVersionIdOfRecord($v['table'], $v['id']))) {
            $GLOBALS['TYPO3_DB']->exec_UPDATEquery($v['table'], 'uid=' . (int)$v['id'], $updateValues);
        }
    }
}

Related issues 1 (0 open1 closed)

Has duplicate TYPO3 Core - Bug #80663: Inline references are bound to versioned pageClosedOliver Hader2017-04-03

Actions
Actions

Also available in: Atom PDF