Project

General

Profile

Actions

Bug #92409

open

Regression with Save and Preview Button

Added by Felix Jacobi about 4 years ago. Updated over 2 years ago.

Status:
Accepted
Priority:
Should have
Assignee:
-
Category:
DataHandler aka TCEmain
Target version:
-
Start date:
2020-09-25
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Hej,

I stumbled onto this yesterday when trying to configure multiple save and preview buttons for different folders and noticed that the links weren't constructed properly, i.e. only no_cache parameter was created.
After debugging this I found a regression here, introduced back in 2018. Line numbers are from v9.5.21, but are also found in v10.

typo3/sysext/backend/Classes/Controller/EditDocumentController.php#1040

$previewConfiguration = BackendUtility::getPagesTSconfig($previewPageId)['TCEMAIN.']['preview.'][$table . '.'] ?? [];

The PageTS is fetched from the target page, i.e. the detail page and not the current backend folder the user is in.
Via git blame I found this review: https://review.typo3.org/c/Packages/TYPO3.CMS/+/56693/36/typo3/sysext/backend/Classes/Controller/EditDocumentController.php#b960

With a small change (I'm not sure if this is the best way to access the current page id in this context) it is working again:

$previewConfiguration = BackendUtility::getPagesTSconfig($this->pageinfo['uid'])['TCEMAIN.']['preview.'][$table . '.'] ?? [];

This might be an issue for pages, since that needed a switch before? Not 100% sure about that, because pages preview worked fine with my change.


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #89263: TCEMAIN.preview doesn't work for routed controller with empty argumentsClosed2019-09-25

Actions
Related to TYPO3 Core - Bug #96667: Save and preview button uses wrong pagetsClosed2022-01-28

Actions
Actions

Also available in: Atom PDF