diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 35e048fcc..26e02e93c 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -7,6 +7,7 @@ - fixed #11646: Post and Thread Last Post - fixed #11626: Duplicate messages from Collab Systems - fixed #11667: Shop: unable to remove item from Cart + - fixed #11550: Pending assets in the clipboard or trash are not visible from the approval screen 7.9.7 - added #11571: Allow return from photo edit view to gallery edit view diff --git a/lib/WebGUI/AssetClipboard.pm b/lib/WebGUI/AssetClipboard.pm index ccf81902c..a179c504f 100644 --- a/lib/WebGUI/AssetClipboard.pm +++ b/lib/WebGUI/AssetClipboard.pm @@ -181,6 +181,7 @@ sub getAssetsInClipboard { { statesToInclude => ["clipboard"], returnObjects => 1, + statusToInclude => [qw/approved pending archived/], whereClause => $limit, } ); diff --git a/lib/WebGUI/AssetTrash.pm b/lib/WebGUI/AssetTrash.pm index 8419f5794..a22acbeaa 100644 --- a/lib/WebGUI/AssetTrash.pm +++ b/lib/WebGUI/AssetTrash.pm @@ -57,39 +57,20 @@ sub getAssetsInTrash { my $self = shift; my $limitToUser = shift; my $userId = shift || $self->session->user->userId; - my @assets; my $limit; if ($limitToUser) { - $limit = "and asset.stateChangedBy=".$self->session->db->quote($userId); + $limit = "asset.stateChangedBy=".$self->session->db->quote($userId); } - my $sth = $self->session->db->read(" - select - asset.assetId, - assetData.revisionDate, - asset.className - from - asset - left join - assetData on asset.assetId=assetData.assetId - where - asset.state='trash' - and assetData.revisionDate=(SELECT max(revisionDate) from assetData where assetData.assetId=asset.assetId) - $limit - group by - assetData.assetId - order by - assetData.title desc - "); - while (my ($id, $date, $class) = $sth->array) { - my $asset = WebGUI::Asset->new($self->session,$id,$class,$date); - if ($asset){ - push(@assets, $asset); - }else{ - $self->session->errorHandler->error("AssetTrash::getAssetsInTrash - failed to instanciate asset with assetId $id, className $class, and revisionDate $date"); - } - } - $sth->finish; - return \@assets; + my $root = WebGUI::Asset->getRoot($self->session); + return $root->getLineage( + ["descendants", ], + { + statesToInclude => ["trash"], + statusToInclude => [qw/approved pending archived/], + returnObjects => 1, + whereClause => $limit, + } + ); } #----------------------------------------------------------------------------