Skip to content

Commit 719746d

Browse files
Fix saving new problems with statements
Fixes #2646. We used to persist the entity both before and after calling the lifecycle callbacks ourselves, which would introduce weird behavior where Doctrine wanted to insert some rows twice. By not persisting before calling the callbacks ourselves, this issue goes away. (cherry picked from commit 9f12b77)
1 parent 6f223ea commit 719746d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
DOMjudge Programming Contest Judging System
22

3+
Version 8.3.2
4+
---------------------------
5+
- Fix saving new problems with problem statement from web UI.
6+
37
Version 8.3.1 - 21 July 2024
48
- Create autoload_runtime.php as normal user to prevent a composer warning.
59

webapp/src/Controller/Jury/ProblemController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1087,7 +1087,6 @@ public function addAction(Request $request): Response
10871087
$form->handleRequest($request);
10881088

10891089
if ($form->isSubmitted() && $form->isValid()) {
1090-
$this->em->persist($problem);
10911090
$this->saveEntity($this->em, $this->eventLogService, $this->dj, $problem, null, true);
10921091
return $this->redirectToRoute('jury_problem', ['probId' => $problem->getProbid()]);
10931092
}

0 commit comments

Comments
 (0)