BUG Fix issue with populateDefault breaking during dev/build

This commit is contained in:
Damian Mooyman 2014-12-08 18:43:50 +13:00
parent 9a56f5aabf
commit f97119941e

View File

@ -50,7 +50,10 @@ class BlogEntry extends Page {
parent::populateDefaults();
$this->setField('Date', date('Y-m-d H:i:s', strtotime('now')));
$this->setField('Author', Member::currentUser() ? Member::currentUser()->getName() : '');
if(Security::database_is_ready() && ($member = Member::currentUser())) {
$this->setField('Author', $member->getName());
}
}
function getCMSFields() {