Project

General

Profile

Actions

Bug #97170

closed

Make backend preview work in workspaces

Added by Francois Suter about 2 years ago. Updated about 1 year ago.

Status:
Resolved
Priority:
Must have
Assignee:
-
Category:
Workspaces
Target version:
Start date:
2022-03-11
Due date:
% Done:

100%

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

Description

It is possible to define a preview configuration for any type of record in the TYPO3 backend, using a Page TSconfig configuration like:

TCEMAIN.preview {
    tx_workspaceextensiontest_foo {
        previewPageId = xxx
        fieldToParameterMap {
            uid = tx_workspacepreviewtest_preview[uid]
        }
        additionalGetParameters {
            tx_workspacepreviewtest_preview.table = tx_workspaceextensiontest_foo
        }
    }
}

where xxx is the uid of a page where - most likely - a plugin will reside.

In workspaces, it is possible to define a page id where preview can happen for any record, using a Page TSconfig configuration like:

options.workspaces.previewPageId = xxx

This setting adds a "Preview" icon in the Workspaces module.

Unfortunately that workspace preview feature does not take the generic backend preview feature into account, which makes it impossible to pass the appropriate parameters to the plugin controller when previewing in a workspace. My proposal is to make \TYPO3\CMS\Workspaces\Preview\PreviewUriBuilder::createPreviewUriForElement() able to handle the generic backend preview configuration.

NOTE: the generic backend preview works fine in workspaces (i.e. when you hit the "View" button when editing a record).


Files

workspace_preview.png (47.4 KB) workspace_preview.png Francois Suter, 2022-03-11 08:13
workspace_preview_test.zip (55.8 KB) workspace_preview_test.zip Francois Suter, 2023-01-27 11:33
Actions #1

Updated by Francois Suter about 2 years ago

I have created a test extension for this problem, as it is not easy to have the proper setup otherwise. To install it use:

composer require fsuter/workspace-preview-test:dev-main

It has a README file with instructions for completing the setup.

The observations are:
  • when editing a record in a workspace and using "View", we get to the split preview alright
  • when trying to use the preview button in the Workspaces module, we get an error from the preview controller, which complains about missing parameters

With the (upcoming) patch, the error does not happen and we get access to the split preview.

Actions #2

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

Actions #3

Updated by Gerrit Code Review about 2 years ago

Patch set 2 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/+/73900

Actions #4

Updated by Gerrit Code Review about 2 years ago

Patch set 3 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/+/73900

Actions #5

Updated by Simon Schaufelberger about 2 years ago

  • Description updated (diff)
Actions #6

Updated by Gerrit Code Review over 1 year ago

Patch set 4 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/+/73900

Actions #7

Updated by Gerrit Code Review over 1 year ago

Patch set 5 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/+/73900

Actions #8

Updated by Gerrit Code Review over 1 year ago

Patch set 6 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/+/73900

Actions #9

Updated by Francois Suter over 1 year ago

Test extension for testing the feature.

Actions #10

Updated by Gerrit Code Review over 1 year ago

Patch set 7 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/+/73900

Actions #11

Updated by Gerrit Code Review over 1 year ago

Patch set 8 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/+/73900

Actions #12

Updated by Gerrit Code Review about 1 year ago

Patch set 9 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/+/73900

Actions #13

Updated by Anonymous about 1 year ago

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

Also available in: Atom PDF