mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
FIX GridField state was being added too late in the process which means no data was being passed through to create a new blog post.
This commit is contained in:
parent
28703e1130
commit
9feee011cf
@ -12,8 +12,8 @@ class GridFieldConfig_BlogPost extends GridFieldConfig_Lumberjack {
|
||||
|
||||
public function __construct($itemsPerPage = null) {
|
||||
parent::__construct($itemsPerPage);
|
||||
$this->removeComponentsByType('SiteTreeEditButton');
|
||||
$this->addComponent(new GridFieldSiteTreeEditButton());
|
||||
$this->removeComponentsByType('GridFieldSiteTreeState');
|
||||
$this->addComponent(new GridFieldBlogPostState());
|
||||
}
|
||||
|
||||
}
|
@ -69,11 +69,6 @@ class Blog extends Page {
|
||||
});
|
||||
|
||||
$fields = parent::getCMSFields();
|
||||
|
||||
// Ensure we're using the BlogPost GridField config and not Lumberjack's
|
||||
$gridField = $fields->dataFieldByName('ChildPages');
|
||||
$gridField->setConfig(GridFieldConfig_BlogPost::create());
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
@ -131,6 +126,7 @@ class Blog extends Page {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* This sets the title for our gridfield
|
||||
*
|
||||
@ -140,6 +136,17 @@ class Blog extends Page {
|
||||
return _t('Blog.LumberjackTitle', 'Blog Posts');
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* This overwrites lumberjacks default gridfield config.
|
||||
*
|
||||
* @return GridFieldConfig
|
||||
*/
|
||||
public function getLumberjackGridFieldConfig() {
|
||||
return GridFieldConfig_Blog::create();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
"type": "silverstripe-module",
|
||||
"require": {
|
||||
"silverstripe/cms": "^3.1.0",
|
||||
"micmania1/silverstripe-lumberjack": "^1.0.0"
|
||||
"micmania1/silverstripe-lumberjack": "~1.1"
|
||||
},
|
||||
"license": "BSD-2-Clause",
|
||||
"authors": [
|
||||
|
Loading…
Reference in New Issue
Block a user