Bug #75499
closed"Save and preview" fails for custom doktypes
100%
Description
1) Configure a custom doktype, as shown in https://docs.typo3.org/typo3cms/CoreApiReference/PageTypes/Index.html#create-new-page-type
2) Create a page with that doktype, add a content element
3) Save the content element
4) Now "Save and preview" the content element
The URL that opens for the preview is not the one with the content element, but the root page.
I would expect the content elements page to be displayed.
The Preview URL is generated in the EditDocumentController. It implements its own logic of whether a record shall be previewed on the current page or on the root page. It entails that only records which reside on a DOKTYPE_DEFAULT page will be previewed on their page.
if ((int)$currentPage['doktype'] === PageRepository::DOKTYPE_DEFAULT) { // try the current page $previewPageId = $currentPageId; } else { // or search for the root page }
On https://docs.typo3.org/typo3cms/CoreApiReference/PageTypes/Index.html#create-new-page-type it says:
The choice of value for the doktype is critical. If you want your custom page type to be displayed in the frontend, you must make sure to choose a doktype smaller than 200. If it’s supposed to be just some storage, choose a doktype larger than 200.
To me this means that all pages with doktypes < 200 can be displayed in the FE (sysfolder as a counterexample has 255). So it seems reasonable to me, to preview records which reside on a doktype < 200 page on the page that they reside on.