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
f65f5b5697
commit
617501efed
@ -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