From 4215a57fca91fd747bbf2ba92bd1ccbcb13d128a Mon Sep 17 00:00:00 2001 From: Roy Johnson Date: Thu, 7 Dec 2006 04:46:21 +0000 Subject: [PATCH] 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. --- docs/gotcha.txt | 4 ++++ lib/WebGUI/AssetTrash.pm | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/gotcha.txt b/docs/gotcha.txt index 0a71d000c..0f2b1314a 100644 --- a/docs/gotcha.txt +++ b/docs/gotcha.txt @@ -34,6 +34,10 @@ save you many hours of grief. Also, the Event List view of the calendar works a little different than it used to. + The upgrade script takes an unusually long time to migrate EventCalendar + wobjects to the new Calendar wobjects. We're looking into the cause but + don't kill your upgrade thinking its hung up, we promise it will finish. + 7.2.0 -------------------------------------------------------------------- * NOTE: if you tried to upgrade to 7.2.0 and it failed during the diff --git a/lib/WebGUI/AssetTrash.pm b/lib/WebGUI/AssetTrash.pm index 262425be5..c5c00008e 100644 --- a/lib/WebGUI/AssetTrash.pm +++ b/lib/WebGUI/AssetTrash.pm @@ -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)}) {