From 00a1537161995d8a2e12a362f376037e4e1d8df7 Mon Sep 17 00:00:00 2001 From: Pack Date: Fri, 1 Nov 2024 11:25:33 +1300 Subject: [PATCH 1/2] 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(); From 7e98a0b944a73f5a0c34b954082904c619b3414b Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Thu, 12 Dec 2024 17:30:01 +1300 Subject: [PATCH 2/2] ENH Update code to reflect changes to LeftAndMain (#912) --- src/Extension/FluentCMSMainExtension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Extension/FluentCMSMainExtension.php b/src/Extension/FluentCMSMainExtension.php index 318f13c2..71832e7a 100644 --- a/src/Extension/FluentCMSMainExtension.php +++ b/src/Extension/FluentCMSMainExtension.php @@ -106,7 +106,7 @@ public function publish_localised_copy($data, $form) protected function getRecordForLocalisedAction($data, $form): ?DataObject { $id = (int) $data['ID']; - $className = $this->owner->config()->get('model_class'); + $className = $this->owner->getModelClass(); if (!$id || !$className) { // Invalid inputs