From 00a1537161995d8a2e12a362f376037e4e1d8df7 Mon Sep 17 00:00:00 2001 From: Pack Date: Fri, 1 Nov 2024 11:25:33 +1300 Subject: [PATCH] FIX: fix error page code 404 can not CMS preview --- src/Middleware/LocaleSwitchRedirector.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Middleware/LocaleSwitchRedirector.php b/src/Middleware/LocaleSwitchRedirector.php index dc3399b1..c18c208a 100644 --- a/src/Middleware/LocaleSwitchRedirector.php +++ b/src/Middleware/LocaleSwitchRedirector.php @@ -32,6 +32,7 @@ public function process(HTTPRequest $request, callable $delegate) if ($response->getStatusCode() === 404 && !$state->getIsFrontend() && $this->getParamLocale($request) + && !$request->getVar('CMSPreview') ) { // Redirect to the CMS home page if the requested page doesn't exist $response = new HTTPResponse();