Project

General

Profile

Actions

Bug #98916

closed

Workspace preview can not publish moved content elements

Added by Tim Horstmann over 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Workspaces
Target version:
-
Start date:
2022-10-25
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.1
Tags:
workspace publish
Complexity:
Is Regression:
Sprint Focus:

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.

Steps to reproduce:
  • 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

workspace-module.PNG (5.72 KB) workspace-module.PNG Tim Horstmann, 2022-11-08 13:18
workspace-preview.PNG (4.18 KB) workspace-preview.PNG Tim Horstmann, 2022-11-08 13:18
Actions

Also available in: Atom PDF