Fix: display also social actions linked to parents of the selected social issue

This commit is contained in:
2025-10-29 12:44:00 +01:00
parent 9c2abb2dfa
commit 0f03413383
2 changed files with 17 additions and 2 deletions

View File

@@ -0,0 +1,6 @@
kind: Fixed
body: 'Fix: display also social actions linked to parents of the selected social issue'
time: 2025-10-29T12:43:55.008647232+01:00
custom:
Issue: "451"
SchemaChange: No schema change

View File

@@ -239,13 +239,22 @@ class SocialIssue
}
/**
* @return Collection<SocialAction> All the descendant social actions of all
* the descendants of the entity
* @return Collection<SocialAction> All the social actions of the entity, it's
* the descendants and it's parents
*/
public function getRecursiveSocialActions(): Collection
{
$recursiveSocialActions = new ArrayCollection();
// Get social actions from parent issues
foreach ($this->getAncestors(false) as $ancestor) {
foreach ($ancestor->getDescendantsSocialActions() as $descendant) {
if (!$recursiveSocialActions->contains($descendant)) {
$recursiveSocialActions->add($descendant);
}
}
}
foreach ($this->getDescendantsWithThis() as $socialIssue) {
foreach ($socialIssue->getDescendantsSocialActions() as $descendant) {
if (!$recursiveSocialActions->contains($descendant)) {