fixes for weaken and iterator

This commit is contained in:
Doug Bell 2010-06-01 19:37:53 -05:00
parent 60cefb3102
commit 247c607393
22 changed files with 83 additions and 47 deletions

View file

@ -265,8 +265,15 @@ sub trash {
return undef;
}
my $assets = $self->getLineage(['self','descendants']);
while ( my $asset = $assets->() ) {
my $assetIter = $self->getLineageIterator(['self','descendants']);
while ( 1 ) {
my $asset;
eval { $asset = $assetIter->() };
if ( my $x = WebGUI::Error->caught('WebGUI::Error::ObjectNotFound') ) {
$session->log->error($x->full_message);
next;
}
last unless $asset;
$outputSub->($i18n->get('Clearing search index'));
my $index = WebGUI::Search::Index->new($asset);
$index->delete;