mirror of
https://github.com/silverstripe/silverstripe-comments
synced 2024-10-22 11:05:49 +02:00
comments extension filters on Parent Class
This allows both pages and DataObjects to have comments without the ParentID clashing and showing comments on a page where the ParentID is the Same as a DataObjects or even two DataObjects having the sameID
This commit is contained in:
parent
780ea22b93
commit
82845626bc
@ -254,7 +254,10 @@ class CommentsExtension extends DataExtension
|
||||
{
|
||||
$order = $this->owner->getCommentsOption('order_comments_by');
|
||||
$comments = Comment::get()
|
||||
->filter('ParentID', $this->owner->ID)
|
||||
->filter([
|
||||
'ParentID' => $this->owner->ID,
|
||||
'ParentClass' => $this->owner->ClassName,
|
||||
])
|
||||
->sort($order);
|
||||
$this->owner->extend('updateAllComments', $comments);
|
||||
return $comments;
|
||||
|
Loading…
Reference in New Issue
Block a user