Project

General

Profile

Actions

Bug #38063

closed

Content elements disappear on publishing a page

Added by Andreas Kiessling almost 12 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
Workspaces
Target version:
Start date:
2012-06-15
Due date:
% Done:

0%

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

Description

With #30604 a severe Bug in 4.7 was introduced with these effects:

  • content on a newly created page in a workspace will not be shown in the page module (but is inserted like it should twice in the db (INITIAL PLACEHOLDER and First draft version)
  • after publishing the page and the content, both content elements are deleted from the db (not just marked deleted, but really deleted)

This is caused by the missing t3ver_swapmode in TCEmain: (code from 4.5)

$fieldArray['pid'] = -1;
$fieldArray['t3ver_oid'] = $this->substNEWwithIDs[$id];
$fieldArray['t3ver_id'] = 1;
$fieldArray['t3ver_state'] = -1; // Setting placeholder state value for version (so it can know it is currently a new version...)
$fieldArray['t3ver_label'] = 'First draft version';
$fieldArray['t3ver_wsid'] = $this->BE_USER->workspace;
if ($table === 'pages') { // Swap mode set to "branch" so we can build branches for pages.
    $fieldArray['t3ver_swapmode'] = $versioningType;
}
$phShadowId = $this->insertDB($table, $id, $fieldArray, TRUE, 0, TRUE); 

TCA ref says, that t3ver_swapmode is exclusive to pages, so it would be ok to remove the field, if there were not over 30 occurances of t3ver_swapmode throughout the core.
With 0 in that field, the wrong page record / id is fetched in these cases, since i guess it behaves like newPagesVersioningType was set to 0 (page) which is "known for the drawbacks of loosing ids"

Quick fix: reintroduce 3 lines to always set t3ver_swapmode to -1 for the workspace pages

$fieldArray['t3ver_label'] = 'First draft version';
$fieldArray['t3ver_wsid'] = $this->BE_USER->workspace;
if ($table === 'pages') {
    $fieldArray['t3ver_swapmode'] = -1;
}
$phShadowId = $this->insertDB($table, $id, $fieldArray, TRUE, 0, TRUE); // 

Real fix: all checks/occurences of t3ver_swapmode must be adopted to behave like this was set to -1


Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Task #30604: Remove unsupported functions and options related to versioning/workspacesClosedBenni Mack2011-10-06

Actions
Related to TYPO3 Core - Bug #38607: Remove t3ver_swapmode code blocksClosedOliver Hader2012-07-03

Actions
Related to TYPO3 Core - Bug #38608: Remove t3ver_swapmode code blocksClosedOliver Hader2012-07-03

Actions
Actions

Also available in: Atom PDF