mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 09:05:58 +00:00
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:
parent
638b309b69
commit
559ccd9e6b
@ -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() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user