migrate to getLineageIterator to save memory
This commit is contained in:
parent
cc87552a22
commit
2c75ab27e6
34 changed files with 794 additions and 187 deletions
|
|
@ -383,13 +383,20 @@ ENDHTML
|
|||
|
||||
### Crumbtrail
|
||||
my $crumb_markup = '<li><a href="%s">%s</a> ></li>';
|
||||
my $ancestors = $currentAsset->getLineage( ['ancestors'], { returnObjects => 1 } );
|
||||
my $ancestorIter = $currentAsset->getLineageIterator( ['ancestors'] );
|
||||
|
||||
$output .= '<ol id="crumbtrail">';
|
||||
for my $asset ( @{ $ancestors } ) {
|
||||
while ( 1 ) {
|
||||
my $ancestor;
|
||||
eval { $ancestor = $ancestorIter->() };
|
||||
if ( my $x = WebGUI::Error->caught('WebGUI::Error::ObjectNotFound') ) {
|
||||
$session->log->error($x->full_message);
|
||||
next;
|
||||
}
|
||||
last unless $ancestor;
|
||||
$output .= sprintf $crumb_markup,
|
||||
$asset->getUrl( 'op=assetManager;method=manage' ),
|
||||
$asset->get( "menuTitle" ),
|
||||
$ancestor->getUrl( 'op=assetManager;method=manage' ),
|
||||
$ancestor->get( "menuTitle" ),
|
||||
;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,6 @@ sub handler {
|
|||
}
|
||||
|
||||
my $pages = WebGUI::Asset->getRoot($session)->getLineageIterator(["self","descendants"],{
|
||||
returnObjects => 1,
|
||||
includeOnlyClasses => ["WebGUI::Asset::Wobject::Layout"],
|
||||
whereClause => $whereClause,
|
||||
limit => 20000
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue