DOMjudge / domjudge

DOMjudge programming contest jury system
https://www.domjudge.org
GNU General Public License v2.0
719 stars 254 forks source link

refix #2279: get associated ContestProblem with Clarification entity #2607

Closed moesoha closed 3 months ago

moesoha commented 3 months ago

This PR fixes #2279 indeed. In the previous commit 0219d8e173540e26b5867d219753dcb23f08fcc5, this issue was accidentally "fixed" by abusing LEFT JOIN. Thanks to Doctrine's mapping & collection strategies, that commit works.

This PR implements getContestProblem(Problem $problem) in Contest entity by moving the codes in TwigExtension::problemBadgeForProblemAndContest, and adds a getter for the associated ContestProblem in Clarification entity. With these helpers, the key code of #2279 (clarification.problem.contestProblems.first) can be replaced with clarification.contestProblem.

By the way, I renamed the twig filter problemBadgeForProblemAndContest to problemBadgeForContest, as the Problem is redundant here.

0219d8e173540e26b5867d219753dcb23f08fcc5 is reverted in this PR, so the bug mentioned in #2600 no longer exists.

moesoha commented 3 months ago

Any update? Sorry for disturbing but I would like to request a review @vmcj

vmcj commented 3 months ago

Any update? Sorry for disturbing but I would like to request a review @vmcj

Hi @moesoha, I think all of us are currently very busy so it might take a bit more time.