Merge pull request #285 from dunatron/patch-2

comments extension filters on Parent Class
This commit is contained in:
Robbie Averill 2019-05-16 15:33:09 +12:00 committed by GitHub
commit 9c4ec173fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;