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
Updated by Tim Horstmann almost 2 years ago
- File workspace-module.PNG workspace-module.PNG added
- File workspace-preview.PNG workspace-preview.PNG added
Updated by Tim Horstmann almost 2 years ago
- File deleted (
workspace-preview.PNG)
Updated by Tim Horstmann almost 2 years ago
Don't know how to edit the description :-(
The bug can be reproduced in 12.1 also. So I set TYPO3 version to 12 and hope for a backport for 11.5.
Tim Horstmann wrote:
In TYPO3\CMS\Workspaces\Service\WorkspaceService->getNextStageForElementCollection ...
The method is implemented in TYPO3\CMS\Workspaces\Service\StageService.
the new order is not displayed in the preview. This might be another bug not handled in this issue.
Tested this in 12.1, can not reproduce the wrong behaviour.
Updated by Gerrit Code Review almost 2 years ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/76525
Updated by Gerrit Code Review over 1 year ago
Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/77758
Updated by Tim Horstmann over 1 year ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 2115fe399dea3e8f8d134dcd02f854a5147d9de1.