Fix incorrect link generation for testcase audit logs #3112
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The stored ID in the audit log is the problem ID, not a testcase ID
So searching for a testcase by a problem ID results in an incorrect link to a completely different problem.
Storing the problematic audit log happens here
domjudge/webapp/src/Controller/Jury/ProblemController.php
Line 634 in af92629
I also saw a generic audit log mechanism in BaseController
domjudge/webapp/src/Controller/BaseController.php
Line 154 in af92629
I am wondering if this is a correct-intended behavior. On one side, I see performance/logical reasons why to store only the problem ID, but keeping consistency in mind, it would also seem logical to store the testcase ID and look up the problem ID as it was originally coded.
Should we change the
in all 3 locations to pass a testcase ID instead? Or use the change in the link generation I provided in this MR?
domjudge/webapp/src/Controller/Jury/ProblemController.php
Line 634 in af92629
domjudge/webapp/src/Controller/Jury/ProblemController.php
Line 736 in af92629
domjudge/webapp/src/Controller/Jury/ProblemController.php
Line 863 in af92629