Skip to content

Commit

Permalink
Select shortname from current contestproblem
Browse files Browse the repository at this point in the history
If you test a problem in contest A with shortname "bla" and run your
real contest B (problem shortname "C") we would pick the first
contestProblem so we would have displayed "bla" for the clarification.

Fixes DOMjudge#2279

(cherry picked from commit f3725a1)
  • Loading branch information
vmcj committed May 28, 2024
1 parent 07e7ec5 commit 0219d8e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions webapp/src/Controller/Team/MiscController.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,12 @@ public function homeAction(Request $request): Response
$clarifications = $this->em->createQueryBuilder()
->from(Clarification::class, 'c')
->leftJoin('c.problem', 'p')
->leftJoin('p.contest_problems', 'cp')
->leftJoin('c.sender', 's')
->leftJoin('c.recipient', 'r')
->select('c', 'p')
->select('c', 'cp', 'p')
->andWhere('c.contest = :contest')
->andWhere('cp.contest = :contest')
->andWhere('c.sender IS NULL')
->andWhere('c.recipient = :team OR c.recipient IS NULL')
->setParameter('contest', $contest)
Expand All @@ -112,10 +114,12 @@ public function homeAction(Request $request): Response
$clarificationRequests = $this->em->createQueryBuilder()
->from(Clarification::class, 'c')
->leftJoin('c.problem', 'p')
->leftJoin('p.contest_problems', 'cp')
->leftJoin('c.sender', 's')
->leftJoin('c.recipient', 'r')
->select('c', 'p')
->select('c', 'cp', 'p')
->andWhere('c.contest = :contest')
->andWhere('cp.contest = :contest')
->andWhere('c.sender = :team')
->setParameter('contest', $contest)
->setParameter('team', $team)
Expand Down

0 comments on commit 0219d8e

Please sign in to comment.