Bug #92409
openRegression with Save and Preview Button
0%
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.