setValue on lazy dbObjects

This commit is contained in:
Andrew Aitken-Fincham 2017-02-07 09:51:27 +00:00
parent bb08242edb
commit b054cc2759

View File

@ -501,6 +501,8 @@ class BlogPost extends Page
* @var DBDatetime $publishDate
*/
$publishDate = $this->dbObject('PublishDate');
$publishDate->setValue($this->PublishDate);
if (!$publishDate->exists()) {
return false;
}
@ -600,6 +602,7 @@ class BlogPost extends Page
* @var DBDatetime $date
*/
$date = $this->dbObject('PublishDate');
$date->setValue($this->PublishDate);
if ($type != 'year') {
if ($type == 'day') {
@ -628,6 +631,7 @@ class BlogPost extends Page
* @var DBDatetime $date
*/
$date = $this->dbObject('PublishDate');
$date->setValue($this->PublishDate);
return Controller::join_links($this->Parent()->Link('archive'), $date->format('Y'));
}