FIX If BlogPost has date field, return it in getDate

This commit is contained in:
Daniel Hensby 2017-07-26 15:22:36 +01:00
parent 0b6a2d710a
commit 3a18b9f69b
No known key found for this signature in database
GPG Key ID: B00D1E9767F0B06E

View File

@ -693,6 +693,9 @@ class BlogPost extends Page
*/ */
public function getDate() public function getDate()
{ {
if ($this->hasDatabaseField('Date')) {
return $this->getField('Date');
}
return !empty($this->PublishDate) ? $this->PublishDate : null; return !empty($this->PublishDate) ? $this->PublishDate : null;
} }