From 0124008e13c7f0e4e29892cac026afcfa60b2efa Mon Sep 17 00:00:00 2001 From: oscarholt <38869989+oscarholt@users.noreply.github.com> Date: Mon, 16 Jan 2023 13:14:41 +1300 Subject: [PATCH] patch updateSummaryFields (#16) --- src/Model/Extension/SeoPageExtension.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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'); } }