mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
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. Also Fixed SS_Datetime as @dhenby request
This commit is contained in:
parent
638b309b69
commit
611865f88f
@ -49,9 +49,12 @@ class BlogEntry extends Page {
|
||||
public function populateDefaults(){
|
||||
parent::populateDefaults();
|
||||
|
||||
$this->setField('Date', date('Y-m-d H:i:s', strtotime('now')));
|
||||
$requestedDevBuild = (stripos(Controller::curr()->request->getURL(), 'dev/build') === 0);
|
||||
if($requestedDevBuild){
|
||||
$this->setField('Date', SS_Datetime::now()-> Rfc2822());
|
||||
$this->setField('Author', Member::currentUser() ? Member::currentUser()->getName() : '');
|
||||
}
|
||||
}
|
||||
|
||||
function getCMSFields() {
|
||||
Requirements::javascript('blog/javascript/bbcodehelp.js');
|
||||
|
Loading…
Reference in New Issue
Block a user