migrate to getLineageIterator to save memory
This commit is contained in:
parent
cc87552a22
commit
2c75ab27e6
34 changed files with 794 additions and 187 deletions
|
|
@ -607,10 +607,10 @@ returns true if the EMS has subission forms attached
|
|||
sub hasSubmissionForms {
|
||||
my $self = shift;
|
||||
# are there ~any~ forms attached to this ems?
|
||||
my $res = $self->getLineage(['children'],{ limit => 1,
|
||||
my $count = $self->getDescendantCount({
|
||||
includeOnlyClasses => ['WebGUI::Asset::EMSSubmissionForm'],
|
||||
} );
|
||||
return scalar(@$res);
|
||||
return $count;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -1038,12 +1038,12 @@ then call www_editSubmission on it
|
|||
sub www_editSubmission {
|
||||
my $self = shift;
|
||||
my $submissionId = $self->session->form->get('submissionId');
|
||||
my $asset = $self->getLineage(['descendants'], { returnObjects => 1,
|
||||
my $asset = $self->getLineageIterator(['descendants'], {
|
||||
joinClass => "WebGUI::Asset::EMSSubmission",
|
||||
whereClause => 'submissionId = ' . int($submissionId),
|
||||
includeOnlyClasses => ['WebGUI::Asset::EMSSubmission'],
|
||||
} );
|
||||
return $asset->[0]->www_editSubmission;
|
||||
return $asset->()->www_editSubmission;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1389,6 +1389,7 @@ sub www_getBadgesAsJson {
|
|||
my ($db, $form) = $session->quick(qw(db form));
|
||||
my %results = ();
|
||||
$results{records} = [];
|
||||
# TODO: Use getLineageIterator here instead
|
||||
BADGE: foreach my $badge (@{$self->getBadges}) {
|
||||
next BADGE unless $badge->canView;
|
||||
push(@{$results{records}}, {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue