Skip to content

Commit a714386

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 DOMjudge#2279
1 parent ca49ab6 commit a714386

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

webapp/src/Controller/Team/MiscController.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,12 @@ public function homeAction(Request $request): Response
104104
$clarifications = $this->em->createQueryBuilder()
105105
->from(Clarification::class, 'c')
106106
->leftJoin('c.problem', 'p')
107+
->leftJoin('p.contest_problems', 'cp')
107108
->leftJoin('c.sender', 's')
108109
->leftJoin('c.recipient', 'r')
109-
->select('c', 'p')
110+
->select('c', 'cp', 'p')
110111
->andWhere('c.contest = :contest')
112+
->andWhere('cp.contest = :contest')
111113
->andWhere('c.sender IS NULL')
112114
->andWhere('c.recipient = :team OR c.recipient IS NULL')
113115
->setParameter('contest', $contest)
@@ -121,10 +123,12 @@ public function homeAction(Request $request): Response
121123
$clarificationRequests = $this->em->createQueryBuilder()
122124
->from(Clarification::class, 'c')
123125
->leftJoin('c.problem', 'p')
126+
->leftJoin('p.contest_problems', 'cp')
124127
->leftJoin('c.sender', 's')
125128
->leftJoin('c.recipient', 'r')
126-
->select('c', 'p')
129+
->select('c', 'cp', 'p')
127130
->andWhere('c.contest = :contest')
131+
->andWhere('cp.contest = :contest')
128132
->andWhere('c.sender = :team')
129133
->setParameter('contest', $contest)
130134
->setParameter('team', $team)

0 commit comments

Comments
 (0)