I have a SilverStripe\ErrorPage\ErrorPage page type in the project which sets the ErrorCode to 404. When I am in the CMS, to split view to preview the page. it shows the/admin/pages page instead. I have found this caused by LocaleSwitchRedirector.
How to reproduce
Create any two locales
Edit ErrorPage type with 404 code
Preview the page by split view, you will see it display the admin/pages instead of error page template.
Possible Solution
I have temporarily fixed it by using the Injector and added the additional condition for it, !$request->getVar('CMSPreview').
Additional Context
Validations
[X] Check that there isn't already an issue that reports the same bug
[X] Double check that your reproduction steps work in a fresh installation of silverstripe/installer (with any code examples you've provided)
Module version(s) affected
7.1
Description
I have a
SilverStripe\ErrorPage\ErrorPage
page type in the project which sets the ErrorCode to 404. When I am in the CMS, to split view to preview the page. it shows the/admin/pages
page instead. I have found this caused by LocaleSwitchRedirector.How to reproduce
Possible Solution
I have temporarily fixed it by using the Injector and added the additional condition for it,
!$request->getVar('CMSPreview'
).Additional Context
Validations
silverstripe/installer
(with any code examples you've provided)