Skip to content

Commit d4dbc86

Browse files
authored
Merge pull request #1691 from griidc/epic/PELAGOS-5423-new-landing-pages-for-funding-cycle-and-person-page
Remove duplicates
2 parents 762c2d2 + 5b8d662 commit d4dbc86

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/Entity/FundingCycle.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,10 @@ public function getPeople(): Collection
277277

278278
foreach ($this->getResearchGroups() as $researchGroup) {
279279
foreach ($researchGroup->getPersonResearchGroups() as $personResearchGroup) {
280-
$people->add($personResearchGroup->getPerson());
280+
$person = $personResearchGroup->getPerson();
281+
if (!$people->contains($person)) {
282+
$people->add($person);
283+
}
281284
}
282285
}
283286

src/Entity/ResearchGroup.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,10 @@ public function getPeople(): Collection
622622
{
623623
$people = new ArrayCollection();
624624
foreach ($this->getPersonResearchGroups() as $personResearchGroup) {
625-
$people->add($personResearchGroup->getPerson());
625+
$person = $personResearchGroup->getPerson();
626+
if (!$people->contains($person)) {
627+
$people->add($person);
628+
}
626629
}
627630

628631
return $people;

0 commit comments

Comments
 (0)