From 6270a7a1c4124825c2023e77aadefd2d65528d97 Mon Sep 17 00:00:00 2001 From: Morven Date: Mon, 2 Jul 2012 12:47:34 +0100 Subject: [PATCH] Add author field to populateDefaults() so it is pre-populateed in CMS --- code/BlogEntry.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/BlogEntry.php b/code/BlogEntry.php index 5e0a869..855995b 100644 --- a/code/BlogEntry.php +++ b/code/BlogEntry.php @@ -47,6 +47,9 @@ class BlogEntry extends Page { parent::populateDefaults(); $this->setField('Date', date('Y-m-d H:i:s', strtotime('now'))); + + if(Member::currentUser()) + $this->setField('Author',Member::currentUser()->FirstName); } function getCMSFields() {