Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions webapp/src/Controller/API/ClarificationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,10 @@ protected function getQueryBuilder(Request $request): QueryBuilder
->leftJoin('clar.sender', 's')
->leftJoin('clar.recipient', 'r')
->leftJoin('clar.problem', 'p')
->innerJoin('c.problems', 'cp')
->select('clar, c, r, reply, p')
->andWhere('clar.contest = :cid')
->andWhere('clar.problem IS NULL OR clar.problem = cp.problem')
->setParameter('cid', $this->getContestId($request))
->orderBy('clar.clarid');

Expand Down
7 changes: 6 additions & 1 deletion webapp/src/Controller/Jury/ClarificationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,12 @@ public function viewAction(Request $request, int $id): Response
$clarcontest = $contest->getShortname();
$data['subjectlink'] = null;
if ($clar->getProblem()) {
$concernssubject = $contest->getCid() . "-" . $clar->getProblem()->getProbid();
if ($clar->getContestProblem()) {
$concernssubject = $contest->getCid() . "-" . $clar->getProblem()->getProbid();
} else {
// Very special case, this problem is unlinked.
$concernssubject = "";
}
$data['subjectlink'] = $this->generateUrl('jury_problem', ['probId' => $clar->getProblem()->getProbid()]);
} elseif ($clar->getCategory()) {
$concernssubject = $contest->getCid() . "-" . $clar->getCategory();
Expand Down
6 changes: 3 additions & 3 deletions webapp/src/Twig/TwigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -1179,9 +1179,9 @@ public function fileTypeIcon(string $type): string
return 'fas fa-file-' . $iconName;
}

public function problemBadge(ContestProblem $problem, bool $grayedOut = false): string
public function problemBadge(?ContestProblem $problem, bool $grayedOut = false): string
{
$rgb = Utils::convertToHex($problem->getColor() ?? '#ffffff');
$rgb = Utils::convertToHex($problem?->getColor() ?? '#ffffff');
if ($grayedOut || empty($rgb)) {
$rgb = Utils::convertToHex('whitesmoke');
}
Expand All @@ -1197,7 +1197,7 @@ public function problemBadge(ContestProblem $problem, bool $grayedOut = false):
$rgb,
$border,
$foreground,
$problem->getShortname()
$problem?->getShortname() ?? '?'
);
}

Expand Down
Loading