migrate to getLineageIterator to save memory
This commit is contained in:
parent
cc87552a22
commit
2c75ab27e6
34 changed files with 794 additions and 187 deletions
|
|
@ -125,8 +125,18 @@ the available Rich Text Editor assets.
|
|||
|
||||
sub getOptions {
|
||||
my $self = shift;
|
||||
my $editors = WebGUI::Asset->getRoot($self->session)->getLineage(['descendants'], {includeOnlyClasses => ['WebGUI::Asset::RichEdit'], returnObjects => 1});
|
||||
my %options = map { $_->getId => $_->getTitle } @$editors;
|
||||
my $editorIter = WebGUI::Asset->getRoot($self->session)->getLineageIterator( ['descendants'], {includeOnlyClasses => ['WebGUI::Asset::RichEdit']});
|
||||
my %options;
|
||||
while ( 1 ) {
|
||||
my $editor;
|
||||
eval { $editor = $editorIter->() };
|
||||
if ( my $x = WebGUI::Error->caught('WebGUI::Error::ObjectNotFound') ) {
|
||||
$session->log->error($x->full_message);
|
||||
next;
|
||||
}
|
||||
last unless $editor;
|
||||
$options{ $editor->getId } = $editor->getTitle;
|
||||
}
|
||||
return \%options;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue