Skip to content

Commit 3c5ea57

Browse files
committed
Fixing a bug that pending review and review requests appear in dashboard summary (as well as in mail notifications) even for archived groups (archived groups are now excluded).
1 parent 6d522b2 commit 3c5ea57

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/model/repository/AssignmentSolutions.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,11 @@ public function filterBestSolutions(array $solutions): array
273273
public function findLingeringReviews(DateTime $threshold): array
274274
{
275275
$qb = $this->createQueryBuilder('s');
276+
$qb->innerJoin("s.assignment", "a")->innerJoin("a.group", "g");
276277
$qb->where($qb->expr()->isNull("s.reviewedAt"))
277278
->andWhere($qb->expr()->isNotNull("s.reviewStartedAt"))
278279
->andWhere($qb->expr()->lt("s.reviewStartedAt", ":threshold"))
280+
->andWhere($qb->expr()->isNull("g.archivedAt"))
279281
->setParameter('threshold', $threshold);
280282
return $qb->getQuery()->getResult();
281283
}
@@ -293,6 +295,7 @@ public function findPendingReviewsOfTeacher(User $user): array
293295
->andWhere($qb->expr()->in("gm.type", [ GroupMembership::TYPE_ADMIN, GroupMembership::TYPE_SUPERVISOR ]))
294296
->andWhere($qb->expr()->isNotNull("s.reviewStartedAt"))
295297
->andWhere($qb->expr()->isNull("s.reviewedAt"))
298+
->andWhere($qb->expr()->isNull("g.archivedAt"))
296299
->setParameter('user', $user->getId());
297300
return $qb->getQuery()->getResult();
298301
}
@@ -380,6 +383,7 @@ public function findReviewRequestSolutionsOfTeacher(User $user): array
380383
->andWhere($qb->expr()->in("gm.type", [ GroupMembership::TYPE_ADMIN, GroupMembership::TYPE_SUPERVISOR ]))
381384
->andWhere($qb->expr()->isNull("s.reviewStartedAt"))
382385
->andWhere($qb->expr()->eq("s.reviewRequest", 1))
386+
->andWhere($qb->expr()->isNull("g.archivedAt"))
383387
->setParameter('user', $user->getId());
384388
return $qb->getQuery()->getResult();
385389
}

0 commit comments

Comments
 (0)