diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 32c23414a..f9a79f4bf 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -12,6 +12,7 @@ - fixed: Importing a package can break when updating a pending asset - fixed: errors on package importing are always reported as corrupted packages - fixed: Optional pubDate RSS field generates warnings when missing + - fixed: Collaboration System threads can return other object types when asked for replies 7.5.7 - fixed: HttpProxy mixes original site's content encoding with WebGUI's diff --git a/lib/WebGUI/Asset/Post/Thread.pm b/lib/WebGUI/Asset/Post/Thread.pm index e706ea7ec..992dbb393 100644 --- a/lib/WebGUI/Asset/Post/Thread.pm +++ b/lib/WebGUI/Asset/Post/Thread.pm @@ -289,8 +289,12 @@ Returns a list of the post objects in this thread, including the thread post its =cut sub getPosts { - my $self = shift; - $self->getLineage(["self","descendants"], {returnObjects=>1, includeArchived=>1}); + my $self = shift; + $self->getLineage(["self","descendants"], { + returnObjects => 1, + includeArchived => 1, + includeOnlyClasses => ["WebGUI::Asset::Post","WebGUI::Asset::Post::Thread"], + }); } #------------------------------------------------------------------- @@ -905,6 +909,7 @@ sub view { left join assetData on assetData.assetId=asset.assetId where asset.lineage like ".$self->session->db->quote($self->get("lineage").'%') ." and asset.state='published' + and asset.className like 'WebGUI::Asset::Post%' and assetData.revisionDate=(SELECT max(assetData.revisionDate) from assetData where assetData.assetId=asset.assetId and ( assetData.status in ('approved','archived')