From 3c5b938da874b11b4a295b6f31e247f87aaefdad Mon Sep 17 00:00:00 2001 From: Michael Vasseur <14887731+vmcj@users.noreply.github.com> Date: Mon, 27 May 2024 21:26:29 +0200 Subject: [PATCH] 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 https://github.com/DOMjudge/domjudge/issues/2279 (cherry picked from commit f3725a1aa56127feed9de3eae96edea231632a12) --- webapp/src/Controller/Team/MiscController.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/webapp/src/Controller/Team/MiscController.php b/webapp/src/Controller/Team/MiscController.php index e714d6737b..648b4bf727 100644 --- a/webapp/src/Controller/Team/MiscController.php +++ b/webapp/src/Controller/Team/MiscController.php @@ -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) @@ -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)