When purging an asset, clean up all version tags for this asset, which may

contain only this asset. Fixes #10872
This commit is contained in:
Colin Kuskie 2009-09-01 22:13:17 +00:00
parent 2703deba2e
commit d8ae7fc68e
3 changed files with 65 additions and 15 deletions

View file

@ -178,6 +178,7 @@ sub purge {
}
# gonna need this at the end
my $tags = $session->db->buildArrayRef('select tagId from assetData where assetId=?',[$self->getId]);
my $tagId = $self->get("tagId");
# clean up keywords
@ -208,10 +209,13 @@ sub purge {
$self = undef;
# clean up version tag if empty
my $versionTag = WebGUI::VersionTag->new($session, $tagId);
if ($versionTag && $versionTag->getAssetCount == 0) {
$versionTag->rollback;
foreach my $tagId (@{ $tags }) {
my $versionTag = WebGUI::VersionTag->new($session, $tagId);
if ($versionTag && $versionTag->getAssetCount == 0) {
$versionTag->rollback;
}
}
return 1;
}