Update BlogEntry.php

BlogEntry:: populateDefaults stops Member from being extended as dev/build runs and this select can't find the field, as its not finished adding the fields. This should stop that process
This commit is contained in:
Phill Price 2014-10-23 21:40:26 +01:00
parent 638b309b69
commit 559ccd9e6b

View File

@ -49,8 +49,11 @@ class BlogEntry extends Page {
public function populateDefaults(){
parent::populateDefaults();
$this->setField('Date', date('Y-m-d H:i:s', strtotime('now')));
$this->setField('Author', Member::currentUser() ? Member::currentUser()->getName() : '');
$requestedDevBuild = (stripos($this->request->getURL(), 'dev/build') === 0);
if(!$requestedDevBuild){
this->setField('Date', date('Y-m-d H:i:s', strtotime('now')));
$this->setField('Author', Member::currentUser() ? Member::currentUser()->getName() : '');
}
}
function getCMSFields() {