From 27ae3ed371a486cefbf7bf74abba07a625de580c Mon Sep 17 00:00:00 2001 From: Bim Date: Mon, 13 Mar 2023 10:57:17 +0800 Subject: [PATCH] use override object when used --- src/Extension/SEODataExtension.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Extension/SEODataExtension.php b/src/Extension/SEODataExtension.php index 194e382..82cda5c 100644 --- a/src/Extension/SEODataExtension.php +++ b/src/Extension/SEODataExtension.php @@ -756,7 +756,7 @@ private function getStructuredDataContext() : ?BaseType public function ComputeMetaTitle() { - $record = $this->owner; + $record = SEODataExtension::get_override() ? : $this->owner; $metaTitle = $record->obj('MetaTitle')->forTemplate(); if (!$metaTitle) { $metaTitle = $record->obj('Title')->forTemplate(); @@ -770,7 +770,7 @@ public function ComputeMetaTitle() public function ComputeMetaDescription() { - $record = $this->owner; + $record = SEODataExtension::get_override() ? : $this->owner; $metaDescription = $record->obj('MetaDescription')->getValue(); if (!$metaDescription && ($fallbackField = $record->config()->get('fallback_meta_description')) && $record->obj($fallbackField)) { $metaDescription = $record->dbObject($fallbackField)->forTemplate();