#93267Aspects setting in routeEnhancers 'blocks' a preview page
Description
Let’s imagine we have a list of postings on a blog or something similar.
The postings have their own page with a slug.
We use the routeEnhancer to create nice links.
The users can create new postings in the frontend and preview them (in FE) before publication (DB data field hidden = 1).
In the list of postings we have links something like this:
https://xyz.ch/postings?tx_extension_plugin[action]=list&tx_extension_plugin[controller]=Posting&tx_extension_plugin[posting]=160&cHash=1991dd7f9cb3b962f399148a8f8ec86b
Slug of posting 160 is: ‘travel-to-new-zealand’
If the page is not hidden (=0), the routeEnhancer delivers the link ‘travel-to-new-zealand’ as defined in the slug.
If the page is hidden (=1), the routeEnhancer respectively the aspects delivers only the output: 160.
Of course, page 160 is not found and a 404 Not Found error results.
However, it shouldn’t be aspects’ responsibility whether it does its job or not if the page is hidden.
Aspects should also work for hidden pages (preview pages in FE).
Reviews 3
History 10
-
Mayer Patrick commented <span data-processor="relativetime" data-value="2021-01-12T13:21:29+00:00" > 01/12/21, 13:21 </span>
No, there are only FE users.
-
Markus Klein commented and changed status
NewNeeds Feedback <span data-processor="relativetime" data-value="2021-01-12T14:37:42+00:00" > 01/12/21, 14:37 </span>Well, then this is expected I would say.
The basic thing is that the Core does not show hidden content.
So the database layer does not deliver a result when the slug is searched for.By default I prefer the current behaviour that the Core delivers the 404 error for hidden records.
If you need custom handling for this I suppose you need some custom code for the Core to resolve also hidden records.Changing this would be a breaking change and would probably now change all 404 errors to 500 errors because the routing would resolve the record and try calling the controller/action with the id, which would not execute unless the code has foreseen this case.
-
Mayer Patrick commented <span data-processor="relativetime" data-value="2021-01-12T14:47:37+00:00" > 01/12/21, 14:47 </span>
Many Thanks.
I already have a customer solution to show hidden data as a preview.
If, from the point of view of the ‘Core’, there is no way to process hidden data, then I ask you to close the issue.Thank you for your commitment.
-
Markus Klein commented <span data-processor="relativetime" data-value="2021-01-12T15:32:09+00:00" > 01/12/21, 15:32 </span>
This could be a new feature for v11 of course.
Wanna share your solution to this here in a comment, so others can find it too?
-
Mayer Patrick commented <span data-processor="relativetime" data-value="2021-01-12T15:37:23+00:00" > 01/12/21, 15:37 </span>
Sure, as soon as I have a solution for it.
-
Oliver Hader changed Sprint Focus On Location Sprint <span data-processor="relativetime" data-value="2022-11-03T14:31:32+00:00" > 11/03/22, 14:31 </span>
-
Benni Mack changed Sprint Focus
On Location Sprint<span data-processor="relativetime" data-value="2023-08-02T13:05:20+00:00" > 08/02/23, 13:05 </span> -
Benni Mack commented <span data-processor="relativetime" data-value="2025-07-24T22:02:23+00:00" > 07/24/25, 22:02 </span>
Any update here? I think this might be solved now since v12.
-
Georg Ringer commented and changed status
Needs FeedbackClosed <span data-processor="relativetime" data-value="2026-11-01T10:56:34+00:00" > 11/01/26, 10:56 </span>Checked on main (d1f2583f675, 15.0.0-dev) with a Simple route enhancer and a
PersistedAliasMapperonpages, without a backend user.A link to a hidden record no longer puts the uid into the path. Since #103400
PageRouter::generateUri()skips a route whose aspect cannot map the value, so the link becomes the query form (/?posting=13&cHash=...). Requests to/item/13and to the slug of the hidden record both give a 404.Fixed by #103400:
- main: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83470 (first release v13.2.0)
- 12.4: https://review.typo3.org/c/Packages/TYPO3.CMS/+/84002 (first release v12.4.15)
- 11.5: https://review.typo3.org/c/Packages/TYPO3.CMS/+/84003 (first release v11.5.37)
That aspects do not resolve hidden records for anonymous visitors is intended and covered by
PersistedAliasMapperTest. For a preview, set aVisibilityAspectin the Context that includes hidden records (#88307), then the slug is generated and resolved as usual. As an alternative you can use a dedicated preview parameter just like EXT:news does that.
Do I understand correctly that the backend user is still active (loggedin) when the record shall be previewed?