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

Updated by Tim Horstmann over 1 year ago

  • File deleted (workspace-module.PNG)
Actions #3

Updated by Tim Horstmann over 1 year ago

  • File deleted (workspace-preview.PNG)
Actions #4

Updated by Tim Horstmann over 1 year 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.

Actions #5

Updated by Tim Horstmann over 1 year ago

  • TYPO3 Version changed from 11 to 12
Actions #6

Updated by Gerrit Code Review over 1 year 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

Actions #7

Updated by Gerrit Code Review about 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

Actions #8

Updated by Tim Horstmann about 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #9

Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF