Bug #98916
closedWorkspace preview can not publish moved content elements
100%
Description
If there are moved content elements (indicated in blue color) in a workspace version of a page, they can not be published in the workspace preview.
Instead, the workspace preview always shows the button "Ready to publish", even if the content element is already in this stage. Sending the content again to stage "Ready to publish" results in a frontend ajax error.
- have a clean TYPO3 v11.5.17
- create 2 Elements on any page
- create a workspace
- switch to this workspace and change the order of the content elements
- the new order is not displayed in the preview. This might be another bug not handled in this issue.
- view workspace preview of this page in a browser
- send all changes to stage "Ready to publish"
- view the workspace preview again
The button "Ready to publish" will be shown again as next stage instead of expected button "Publish to LIVE".
I investigated this a little and found the error in TYPO3\CMS\Workspaces\Service\WorkspaceService->getMovedRecordsFromPages
Here the SQL Query does not select the field "t3ver_stage".
In TYPO3\CMS\Workspaces\Service\WorkspaceService->getNextStageForElementCollection this results in falling back to 0 (which means editing) instead of using the correct value of -10 (which means "ready to publish"). So the next stage is calculated wrong.
foreach ($items as $item) {
$usedStages[$item['t3ver_stage'] ?? 0] = true;
}
Files