Project

General

Profile

Actions

Bug #75499

closed

"Save and preview" fails for custom doktypes

Added by Hannes Lau about 8 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
-
Start date:
2016-04-11
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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.


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #70094: save and preview of backend user section links to home page Closed2015-09-24

Actions
Related to TYPO3 Core - Bug #75020: "Save and view" button shows root page for pages of type "Shortcut" or "Link to External URL"Closed2016-03-11

Actions
Actions #1

Updated by Wouter Wolters about 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.

https://review.typo3.org/#/c/47236/

Actions #2

Updated by Hannes Lau about 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.

Actions #3

Updated by Wouter Wolters almost 8 years ago

  • Status changed from Needs Feedback to Accepted

So the situation is that a custom doktype should work as well.

Actions #4

Updated by Gerrit Code Review almost 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

Actions #5

Updated by Gerrit Code Review almost 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

Actions #6

Updated by Wouter Wolters almost 8 years ago

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

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF