Skip to content
This repository was archived by the owner on Dec 14, 2021. It is now read-only.

Commit 3e5f01d

Browse files
authored
Merge pull request #1647 from ojs/hotfix/author-removal
Make sure deleted authors are actually deleted
2 parents b16cb6a + 184d2fa commit 3e5f01d

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/Ojs/JournalBundle/Controller/ArticleSubmissionController.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,13 @@ public function editAction(Request $request, $id)
396396
);
397397
$this->throw404IfNotFound($article);
398398

399+
$originalAuthors = new ArrayCollection();
399400
$originalFiles = new ArrayCollection();
400401

402+
foreach ($article->getArticleAuthors() as $author) {
403+
$originalAuthors->add($author);
404+
}
405+
401406
foreach ($article->getArticleFiles() as $file) {
402407
$originalFiles->add($file);
403408
}
@@ -418,6 +423,12 @@ public function editAction(Request $request, $id)
418423
$i++;
419424
}
420425

426+
foreach ($originalAuthors as $author) {
427+
if ($article->getArticleAuthors()->contains($author) === false) {
428+
$em->remove($author);
429+
}
430+
}
431+
421432
foreach ($originalFiles as $file) {
422433
if ($article->getArticleFiles()->contains($file) === false) {
423434
$em->remove($file);

0 commit comments

Comments
 (0)