Added a stop gap to assetTrash to keep it from dying if someone tries to purge an asset and the object is not defined.

Also added a note to gotchas warning that the upgrade can take a very long time.
This commit is contained in:
Roy Johnson 2006-12-07 04:46:21 +00:00
parent 1522dafabe
commit 4215a57fca
2 changed files with 7 additions and 1 deletions

View file

@ -101,7 +101,9 @@ sub purge {
my $kids = $self->getLineage(["children"],{returnObjects=>1, statesToInclude=>['published', 'clipboard', 'clipboard-limbo','trash','trash-limbo']});
foreach my $kid (@{$kids}) {
$kid->purge;
# Technically get lineage should never return an undefined object from getLineage when called like this, but it did so this saves the world from destruction.
(defined $kid) ? $kid->purge :
$self->session->errorHandler->warn("getLineage returned an undefined object in the AssetTrash->purge method. Unable to purge asset.");
}
$self->session->db->beginTransaction;
foreach my $definition (@{$self->definition($self->session)}) {