Fixed an unhandled exception in Workflow/Activity/PurgeOldAssetRevisions.pm

This commit is contained in:
JT Smith 2007-04-11 14:36:13 +00:00
parent 025a66e30d
commit e8afd2ad72
2 changed files with 8 additions and 3 deletions

View file

@ -6,6 +6,7 @@
they complete their transaction. they complete their transaction.
- fix: Trouble with Search Users (perlDreamer Consulting, LLC) - fix: Trouble with Search Users (perlDreamer Consulting, LLC)
http://www.plainblack.com/bugs/tracker/trouble-with-search-users http://www.plainblack.com/bugs/tracker/trouble-with-search-users
- fix: Fixed an unhandled exception in Workflow/Activity/PurgeOldAssetRevisions.pm
7.3.14 7.3.14

View file

@ -79,9 +79,13 @@ sub execute {
my $sth = $self->session->db->read("select assetData.assetId,asset.className,assetData.revisionDate from asset left join assetData on asset.assetId=assetData.assetId where assetData.revisionDate<? order by assetData.revisionDate asc", [time() - $self->get("purgeAfter")]); my $sth = $self->session->db->read("select assetData.assetId,asset.className,assetData.revisionDate from asset left join assetData on asset.assetId=assetData.assetId where assetData.revisionDate<? order by assetData.revisionDate asc", [time() - $self->get("purgeAfter")]);
while (my ($id, $class, $version) = $sth->array) { while (my ($id, $class, $version) = $sth->array) {
my $asset = WebGUI::Asset->new($self->session, $id,$class,$version); my $asset = WebGUI::Asset->new($self->session, $id,$class,$version);
if ($asset->getRevisionCount("approved") > 1) { if (defined $asset) {
$asset->purgeRevision; if ($asset->getRevisionCount("approved") > 1) {
} $asset->purgeRevision;
}
} else {
$self->session->errorHandler->error("Could not instanciate asset $id $class $version perhaps it is corrupt.")
}
} }
$sth->finish; $sth->finish;
return $self->COMPLETE; return $self->COMPLETE;