Bug #38063

Content elements disappear on publishing a page

Added by Andreas Kiessling over 8 years ago. Updated almost 3 years ago.

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

0%

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

Related to TYPO3 Core - Task #30604: Remove unsupported functions and options related to versioning/workspaces Closed 2011-10-06
Related to TYPO3 Core - Bug #38607: Remove t3ver_swapmode code blocks Closed 2012-07-03
Related to TYPO3 Core - Bug #38608: Remove t3ver_swapmode code blocks Closed 2012-07-03

Associated revisions

Revision dc952a99 (diff)
Added by Oliver Hader over 8 years ago

[BUGFIX] Content elements disappear on publishing a page

The different ways of versioning (element, page, branch) have
been defined to element versioning some TYPO3 version ago. With
TYPO3 4.7, those settings, especially the handling of the field
t3ver_swapmode has been removed from t3lib_TCEmain.

This leads to a chain of problems since the value of that field
will now be "0" per default which means "page versioning".

Change-Id: I2c45ae6386f7350bb4a063337312dc5d5d6f3cfd
Fixes: #38063
Releases: 6.0, 4.7
Reviewed-on: http://review.typo3.org/12532
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader

Revision 5cc92932 (diff)
Added by Oliver Hader over 8 years ago

[BUGFIX] Content elements disappear on publishing a page

The different ways of versioning (element, page, branch) have
been defined to element versioning some TYPO3 version ago. With
TYPO3 4.7, those settings, especially the handling of the field
t3ver_swapmode has been removed from t3lib_TCEmain.

This leads to a chain of problems since the value of that field
will now be "0" per default which means "page versioning".

Change-Id: Ifa4dd51a02705b29c8b91ba428b18aa976a9e1de
Fixes: #38063
Releases: 6.0, 4.7
Reviewed-on: http://review.typo3.org/12533
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader

History

#1 Updated by Oliver Hader over 8 years ago

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

#2 Updated by Oliver Hader over 8 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

#3 Updated by Gerrit Code Review over 8 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

#4 Updated by Gerrit Code Review over 8 years ago

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

#5 Updated by Gerrit Code Review over 8 years ago

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

#6 Updated by Gerrit Code Review over 8 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

#7 Updated by Gerrit Code Review over 8 years ago

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

#8 Updated by Wouter Wolters over 7 years ago

  • Status changed from Under Review to Resolved

Merged in 6.0 and 4.7

#9 Updated by Michael Stucki almost 7 years ago

  • Category changed from Bugs to Workspaces

#10 Updated by Michael Stucki almost 7 years ago

  • Project changed from Workspaces & Versioning to TYPO3 Core
  • Category changed from Workspaces to Workspaces

#11 Updated by Riccardo De Contardi almost 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF