From b054cc2759b84fdadb3d917a4eb8fa1046983266 Mon Sep 17 00:00:00 2001 From: Andrew Aitken-Fincham Date: Tue, 7 Feb 2017 09:51:27 +0000 Subject: [PATCH] setValue on lazy dbObjects --- src/Model/BlogPost.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Model/BlogPost.php b/src/Model/BlogPost.php index 2abae30..98d235d 100644 --- a/src/Model/BlogPost.php +++ b/src/Model/BlogPost.php @@ -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')); }