From d532d8b72c461e667f17fdfaac41a1bbbddf5f69 Mon Sep 17 00:00:00 2001 From: Anagh Padmanabhan Date: Thu, 15 Sep 2016 17:41:39 +0530 Subject: [PATCH] Bug fix : Changed the condition at which an empty array is returned. --- src/Quintype/Seo/Base.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Quintype/Seo/Base.php b/src/Quintype/Seo/Base.php index eea80ad..07c0b7f 100644 --- a/src/Quintype/Seo/Base.php +++ b/src/Quintype/Seo/Base.php @@ -14,23 +14,28 @@ private function getSeoMetadata() { if(sizeof($this->config['seo-metadata'])>0){ $key = 'owner-type'; + $found = 0; if($this->pageType == 'section'){//If it is a section page. foreach ($this->config['seo-metadata'] as $metadata) { if (array_key_exists($key, $metadata) && $metadata[$key]==$this->pageType && $metadata['owner-id']==$this->section_id) { + $found = 1; return $metadata['data']; - } else { - return array(); } } + if(!$found){ + return array(); + } } else { foreach ($this->config['seo-metadata'] as $metadata) { if (array_key_exists($key, $metadata) && $metadata[$key]==$this->pageType) { + $found = 1; return $metadata['data']; - } else { - return array(); } } + if(!$found){ + return array(); + } } } else {