Skip to content

Commit

Permalink
Fixed bug with meta data extension summary.
Browse files Browse the repository at this point in the history
  • Loading branch information
colintucker committed Jul 27, 2018
1 parent d54deab commit 5d9bd75
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Extensions/Model/MetaDataExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -591,17 +591,17 @@ public function getMetaModified()
*/
public function getMetaSummary()
{
if ($this->owner->SummaryMeta) {
return $this->owner->dbObject('SummaryMeta');
}
$summary = '';

if ($this->owner->hasField('Summary') && $this->owner->Summary) {
return $this->owner->dbObject('Summary');
if ($this->owner->SummaryMeta) {
$summary = $this->owner->SummaryMeta;
} elseif ($this->owner->hasField('Summary') && $this->owner->Summary) {
$summary = $this->owner->Summary;
} elseif ($content = $this->owner->getMetaContent()) {
$summary = sprintf('<p>%s</p>', $this->owner->getContentSummary($content));
}

if ($content = $this->owner->getMetaContent()) {
return DBField::create_field('HTMLFragment', sprintf('<p>%s</p>', $this->owner->getContentSummary($content)));
}
return DBField::create_field('HTMLFragment', $summary);
}

/**
Expand Down

0 comments on commit 5d9bd75

Please sign in to comment.