mirror of
https://github.com/silverstripe/silverstripe-comments
synced 2024-10-22 11:05:49 +02:00
Merge pull request #285 from dunatron/patch-2
comments extension filters on Parent Class
This commit is contained in:
commit
9c4ec173fd
@ -254,7 +254,10 @@ class CommentsExtension extends DataExtension
|
|||||||
{
|
{
|
||||||
$order = $this->owner->getCommentsOption('order_comments_by');
|
$order = $this->owner->getCommentsOption('order_comments_by');
|
||||||
$comments = Comment::get()
|
$comments = Comment::get()
|
||||||
->filter('ParentID', $this->owner->ID)
|
->filter([
|
||||||
|
'ParentID' => $this->owner->ID,
|
||||||
|
'ParentClass' => $this->owner->ClassName,
|
||||||
|
])
|
||||||
->sort($order);
|
->sort($order);
|
||||||
$this->owner->extend('updateAllComments', $comments);
|
$this->owner->extend('updateAllComments', $comments);
|
||||||
return $comments;
|
return $comments;
|
||||||
|
Loading…
Reference in New Issue
Block a user