From c7541e2d17bfac3ac7b788aad30e800e05e28d55 Mon Sep 17 00:00:00 2001 From: James Cocker Date: Fri, 13 Jun 2014 11:45:28 +0100 Subject: [PATCH] BlogPost: onBeforePublish: Removed owner + added 'dbObject' --- model/BlogPost.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/model/BlogPost.php b/model/BlogPost.php index bed684f..3328324 100755 --- a/model/BlogPost.php +++ b/model/BlogPost.php @@ -110,9 +110,9 @@ class BlogPost extends Page { * Update the PublishDate to now, if being published for the first time, and the date hasn't been set to the future. **/ public function onBeforePublish() { - if ($this->owner->obj('PublishDate')->InPast() && !$this->owner->isPublished()) { - $this->owner->setCastedField("PublishDate", time()); - $this->owner->write(); + if ($this->dbObject('PublishDate')->InPast() && !$this->isPublished()) { + $this->setCastedField("PublishDate", time()); + $this->write(); } }