diff --git a/src/Model/Extension/SeoPageExtension.php b/src/Model/Extension/SeoPageExtension.php index 6e0fd6c..bad37af 100644 --- a/src/Model/Extension/SeoPageExtension.php +++ b/src/Model/Extension/SeoPageExtension.php @@ -273,9 +273,13 @@ public function updateSettingsFields(FieldList $fields) public function updateSummaryFields(&$fields) { if(Controller::curr() instanceof SEOAdmin) { - Config::modify()->set($this->owner->ClassName, 'summary_fields', $this->getSummaryFields()); + if($this->owner->class == null){ + return; + } + if(is_object($this->owner->class) && method_exists($this->owner->class, 'remove')) Config::inst()->remove(($this->owner->class), 'summary_fields'); + Config::modify()->set(($this->owner->class), 'summary_fields', $this->getSummaryFields()); - $fields = Config::inst()->get($this->owner->ClassName, 'summary_fields'); + $fields = Config::inst()->get($this->owner->class, 'summary_fields'); } }