Bug #103212
closed
Workspace page preview not working
Added by Hannes Bochmann 6 months ago.
Updated about 1 month ago.
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.
- 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?
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.
- Status changed from Needs Feedback to Under Review
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Closed
Also available in: Atom
PDF