From dbd5797c521285d468c1fe001e4a0c7a869656f0 Mon Sep 17 00:00:00 2001 From: Nik Date: Tue, 13 Oct 2020 00:12:31 +0200 Subject: [PATCH] Add Site class reference String 'Site' will not work with the current setup in SS4 anymore, so this check always fails, resulting in the preview not being hidden as intended. --- src/Admin/MultisitesCmsMainExtension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Admin/MultisitesCmsMainExtension.php b/src/Admin/MultisitesCmsMainExtension.php index 93ac7db..522d543 100644 --- a/src/Admin/MultisitesCmsMainExtension.php +++ b/src/Admin/MultisitesCmsMainExtension.php @@ -104,7 +104,7 @@ public function updateEditForm($form) { $classNameField = $form->Fields()->dataFieldByName('ClassName'); if ($classNameField) { $className = $classNameField->Value(); - if ($className === 'Site') + if ($className === Site::class) { $form->Fields()->removeByName(array(SilverStripeNavigator::class)); $form->removeExtraClass('cms-previewable');