diff --git a/src/ArchiveAdmin.php b/src/ArchiveAdmin.php index a7451a3..6a40b08 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();