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.
Updated by Wouter Wolters over 8 years ago
- Status changed from New to Needs Feedback
Can you test this with current 7.6 branch? There was a fix done on March 14th.
Updated by Hannes Lau over 8 years ago
I saw the patch and talked to Marco Huber (the author). His patch solves the same issue for a number of specific doktypes. This is about solving it for all doktypes < 200.
Updated by Wouter Wolters over 8 years ago
- Status changed from Needs Feedback to Accepted
So the situation is that a custom doktype should work as well.
Updated by Gerrit Code Review over 8 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48036
Updated by Gerrit Code Review over 8 years ago
Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48039
Updated by Wouter Wolters over 8 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 8fe33996357569d32aa2c8c653616938a6ba7ed3.