Skip to content

Commit 0219d8e

Browse files
committed
Select shortname from current contestproblem
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 #2279 (cherry picked from commit f3725a1)
1 parent 07e7ec5 commit 0219d8e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

webapp/src/Controller/Team/MiscController.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,12 @@ public function homeAction(Request $request): Response
9595
$clarifications = $this->em->createQueryBuilder()
9696
->from(Clarification::class, 'c')
9797
->leftJoin('c.problem', 'p')
98+
->leftJoin('p.contest_problems', 'cp')
9899
->leftJoin('c.sender', 's')
99100
->leftJoin('c.recipient', 'r')
100-
->select('c', 'p')
101+
->select('c', 'cp', 'p')
101102
->andWhere('c.contest = :contest')
103+
->andWhere('cp.contest = :contest')
102104
->andWhere('c.sender IS NULL')
103105
->andWhere('c.recipient = :team OR c.recipient IS NULL')
104106
->setParameter('contest', $contest)
@@ -112,10 +114,12 @@ public function homeAction(Request $request): Response
112114
$clarificationRequests = $this->em->createQueryBuilder()
113115
->from(Clarification::class, 'c')
114116
->leftJoin('c.problem', 'p')
117+
->leftJoin('p.contest_problems', 'cp')
115118
->leftJoin('c.sender', 's')
116119
->leftJoin('c.recipient', 'r')
117-
->select('c', 'p')
120+
->select('c', 'cp', 'p')
118121
->andWhere('c.contest = :contest')
122+
->andWhere('cp.contest = :contest')
119123
->andWhere('c.sender = :team')
120124
->setParameter('contest', $contest)
121125
->setParameter('team', $team)

0 commit comments

Comments
 (0)