From 1b55035d8172f3852b9ffcf9dbd0750a8b9bf653 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Mon, 12 Feb 2024 15:16:08 +1300 Subject: [PATCH] FIX Do not default to viewing blocks when selecting others --- src/ArchiveAdmin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ArchiveAdmin.php b/src/ArchiveAdmin.php index a7451a32..6a40b083 100644 --- a/src/ArchiveAdmin.php +++ b/src/ArchiveAdmin.php @@ -68,7 +68,7 @@ public function getEditForm($id = null, $fields = null) { $fields = FieldList::create(); $modelClass = $this->request->getVar('others') ? 'others' : $this->modelClass; - $classInst = Injector::inst()->get($this->modelClass); + $classInst = $modelClass !== 'others' ? Injector::inst()->get($this->modelClass) : null; if (ClassInfo::hasMethod($classInst, 'getArchiveField')) { $listField = $classInst->getArchiveField();