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 #1

Updated by Oliver Hader almost 12 years ago

  • Status changed from New to Accepted
  • Assignee set to Oliver Hader
  • Target version set to 4.7.2
Actions #2

Updated by Oliver Hader almost 12 years ago

  • Subject changed from Severe bug with new pages and content elements in workspace: not shown in page module, deleted after publishing to Content elements disappear on publishing a page
Actions #3

Updated by Gerrit Code Review almost 12 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch version_4-7 has been pushed to the review server.
It is available at http://review.typo3.org/12532

Actions #4

Updated by Gerrit Code Review almost 12 years ago

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/12533

Actions #5

Updated by Gerrit Code Review almost 12 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/12533

Actions #6

Updated by Gerrit Code Review almost 12 years ago

Patch set 2 for branch version_4-7 has been pushed to the review server.
It is available at http://review.typo3.org/12532

Actions #7

Updated by Gerrit Code Review almost 12 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/12533

Actions #8

Updated by Wouter Wolters about 11 years ago

  • Status changed from Under Review to Resolved

Merged in 6.0 and 4.7

Actions #9

Updated by Michael Stucki over 10 years ago

  • Category changed from Bugs to Workspaces
Actions #10

Updated by Michael Stucki over 10 years ago

  • Project changed from 624 to TYPO3 Core
  • Category changed from Workspaces to Workspaces
Actions #11

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF