Merging fixed #8775: Miscount in number of replies in CS Thread.
This commit is contained in:
parent
6f634a44c2
commit
1dde85aad0
3 changed files with 103 additions and 7 deletions
|
|
@ -193,7 +193,7 @@ sub getChildCount {
|
|||
my $self = shift;
|
||||
my $opts = shift || {};
|
||||
my $stateWhere = $opts->{includeTrash} ? '' : "asset.state='published' and";
|
||||
my ($count) = $self->session->db->quickArray("select count(*) from asset, assetData where asset.assetId=assetData.assetId and $stateWhere parentId=? and (assetData.status in ('approved', 'archived') or assetData.tagId=?)", [$self->getId, $self->session->scratch->get('versionTag')]);
|
||||
my ($count) = $self->session->db->quickArray("select count(distinct asset.assetId) from asset, assetData where asset.assetId=assetData.assetId and $stateWhere parentId=? and (assetData.status in ('approved', 'archived') or assetData.tagId=?)", [$self->getId, $self->session->scratch->get('versionTag')]);
|
||||
return $count;
|
||||
}
|
||||
|
||||
|
|
@ -208,7 +208,7 @@ in the clipboard or trash.
|
|||
|
||||
sub getDescendantCount {
|
||||
my $self = shift;
|
||||
my ($count) = $self->session->db->quickArray("select count(*) from asset, assetData where asset.assetId=assetData.assetId and asset.state = 'published' and assetData.status in ('approved','archived') and asset.lineage like ?", [$self->get("lineage")."%"]);
|
||||
my ($count) = $self->session->db->quickArray("select count(distinct asset.assetId) from asset, assetData where asset.assetId=assetData.assetId and asset.state = 'published' and assetData.status in ('approved','archived') and asset.lineage like ?", [$self->get("lineage")."%"]);
|
||||
$count--; # have to subtract self
|
||||
return $count;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue