Bug #103212
closedWorkspace page preview not working
100%
Description
When I want to open a page preview (/typo3/workspace/preview-control/?token=xxx&id=123) in a none-live workspace in a TYPO3 12.4.11 installation I just get the BE loaded again and not the split FE view. Everything is fine in the live workspace.
After some debugging I found out that the route is not matched in TYPO3\CMS\Backend\Routing\Router::matchResult() because the route path for workspace_previewcontrols is configured as "/workspace/preview-control/" and the trailing slash seems troublesome. At least it's the only BE route path that has a trailing slash. When I remove the trailing slash everything works again as expected.
I got these problems at least since TYPO3 12.4.7. I can't tell if this problem does exist in previous TYPO3 versions. At least in TYPO3 10.4 everything works as expected.
On a side note I uninstalled all 3rd party extensions but that didn't change everything. So it seems to happen even with a vanilla installation.
Updated by Christian Kuhn 9 months ago
- Status changed from New to Needs Feedback
Odd. Unable to reproduce.
Here is what I see when I debug $path within Router->matchResult() after first line $path = $request->getUri()->getPath(); in v12:
WS page preview: /typo3/workspace/preview-control/ page module: /typo3/module/web/layout
This looks good to me. Do you maybe by any chance have some internal or external redirect that rewrites the path? Maybe .htaccess / webserver config / ext:redirects extension?
Updated by Hannes Bochmann 9 months ago ยท Edited
That's not the problem. At that point I get the same path. I don't think it's a matter of a redirect. But the line "$result = (new UrlMatcher($this->routeCollection, $requestContext))->match($path);" (142) throws a \Symfony\Component\Routing\Exception\ResourceNotFoundException for the route /typo3/workspace/preview-control/. The route /typo3/workspace/preview-control won't throw an exception. At least this what happens in my case.
Thanks for having a look at it.
Updated by Gerrit Code Review 5 months ago
- Status changed from Needs Feedback to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84741
Updated by Gerrit Code Review 5 months ago
Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84773
Updated by Benni Mack 5 months ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset b2bfb97472e669de2f1f7d2acca58b2508c010f0.