Bug #67486

[DATALOSE] Datahandler writes wrong workspace pid to live records

Added by Andreas Kiessling about 6 years ago. Updated over 3 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

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

Actions
#1

Updated by Alexander Opitz about 6 years ago

  • Target version set to 6.2.14
#2

Updated by Alexander Opitz almost 6 years ago

  • Target version changed from 6.2.14 to 6.2.15
#3

Updated by Alexander Opitz almost 6 years ago

  • Subject changed from Datahandler writes wrong workspace pid to live records to [DATALOSE] Datahandler writes wrong workspace pid to live records
  • Target version changed from 6.2.15 to 6.2.16
#4

Updated by Alexander Opitz over 5 years ago

  • Target version changed from 6.2.16 to 6.2.18
#5

Updated by Riccardo De Contardi about 5 years ago

  • Target version changed from 6.2.18 to Candidate for patchlevel
#6

Updated by Andreas Kiessling over 4 years ago

Bug is still present in 7.6.14

#7

Updated by Philipp Müller over 3 years ago

Bug is still present in 6.2.35 (ELTS), too.

#8

Updated by Alexander Opitz over 3 years ago

  • Has duplicate Bug #80663: Inline references are bound to versioned page added
#9

Updated by Alexander Opitz over 3 years ago

  • Status changed from New to Closed
  • Assignee deleted (Alexander Opitz)
  • Target version deleted (Candidate for patchlevel)

This issue was fixed by #80663 so closing this issue as duplicate.

Also available in: Atom PDF