mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
setValue on lazy dbObjects
This commit is contained in:
parent
bb08242edb
commit
b054cc2759
@ -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'));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user