mirror of
https://github.com/silverstripe/silverstripe-comments
synced 2024-10-22 11:05:49 +02:00
Merge pull request #139 from tractorcow/pulls/fix-dupe-state
BUG Fix each gridfield having triple gridstate components
This commit is contained in:
commit
4d538f565c
@ -46,15 +46,13 @@ class CommentAdmin extends LeftAndMain implements PermissionProvider {
|
||||
return Security::permissionFailure($this);
|
||||
}
|
||||
|
||||
$commentsConfig = CommentsGridFieldConfig::create();
|
||||
|
||||
$newComments = Comment::get()->filter('Moderated', 0);
|
||||
|
||||
$newGrid = new CommentsGridField(
|
||||
'NewComments',
|
||||
_t('CommentsAdmin.NewComments', 'New'),
|
||||
$newComments,
|
||||
$commentsConfig
|
||||
CommentsGridFieldConfig::create()
|
||||
);
|
||||
|
||||
$approvedComments = Comment::get()->filter('Moderated', 1)->filter('IsSpam', 0);
|
||||
@ -63,7 +61,7 @@ class CommentAdmin extends LeftAndMain implements PermissionProvider {
|
||||
'ApprovedComments',
|
||||
_t('CommentsAdmin.ApprovedComments', 'Approved'),
|
||||
$approvedComments,
|
||||
$commentsConfig
|
||||
CommentsGridFieldConfig::create()
|
||||
);
|
||||
|
||||
$spamComments = Comment::get()->filter('Moderated', 1)->filter('IsSpam', 1);
|
||||
@ -72,7 +70,7 @@ class CommentAdmin extends LeftAndMain implements PermissionProvider {
|
||||
'SpamComments',
|
||||
_t('CommentsAdmin.SpamComments', 'Spam'),
|
||||
$spamComments,
|
||||
$commentsConfig
|
||||
CommentsGridFieldConfig::create()
|
||||
);
|
||||
|
||||
$newCount = '(' . count($newComments) . ')';
|
||||
|
@ -495,15 +495,13 @@ class CommentsExtension extends DataExtension {
|
||||
protected function updateModerationFields(FieldList $fields) {
|
||||
Requirements::css(COMMENTS_DIR . '/css/cms.css');
|
||||
|
||||
$commentsConfig = CommentsGridFieldConfig::create();
|
||||
|
||||
$newComments = $this->owner->AllComments()->filter('Moderated', 0);
|
||||
|
||||
$newGrid = new CommentsGridField(
|
||||
'NewComments',
|
||||
_t('CommentsAdmin.NewComments', 'New'),
|
||||
$newComments,
|
||||
$commentsConfig
|
||||
CommentsGridFieldConfig::create()
|
||||
);
|
||||
|
||||
$approvedComments = $this->owner->AllComments()->filter('Moderated', 1)->filter('IsSpam', 0);
|
||||
@ -512,7 +510,7 @@ class CommentsExtension extends DataExtension {
|
||||
'ApprovedComments',
|
||||
_t('CommentsAdmin.Comments', 'Approved'),
|
||||
$approvedComments,
|
||||
$commentsConfig
|
||||
CommentsGridFieldConfig::create()
|
||||
);
|
||||
|
||||
$spamComments = $this->owner->AllComments()->filter('Moderated', 1)->filter('IsSpam', 1);
|
||||
@ -521,7 +519,7 @@ class CommentsExtension extends DataExtension {
|
||||
'SpamComments',
|
||||
_t('CommentsAdmin.SpamComments', 'Spam'),
|
||||
$spamComments,
|
||||
$commentsConfig
|
||||
CommentsGridFieldConfig::create()
|
||||
);
|
||||
|
||||
$newCount = '(' . count($newComments) . ')';
|
||||
|
Loading…
Reference in New Issue
Block a user