vue activity: fix backend when hidden return empty string

This commit is contained in:
2021-06-29 14:31:56 +02:00
parent 2a974e1269
commit 9d9be7f831
3 changed files with 10 additions and 8 deletions

View File

@@ -123,13 +123,16 @@ class ActivityType extends AbstractType
return implode(',', $socialIssueIds);
},
function (?string $socialIssuesAsString): array {
if (null === $socialIssuesAsString) {
return [];
}
return array_map(
fn(string $id): ?SocialIssue => $this->om->getRepository(SocialIssue::class)->findOneBy(['id' => (int) $id]),
explode(',', $socialIssuesAsString)
);
}
))
;
;
}
if ($activityType->isVisible('socialActions') && $accompanyingPeriod) {
@@ -144,13 +147,16 @@ class ActivityType extends AbstractType
return implode(',', $socialActionIds);
},
function (?string $socialActionsAsString): array {
if (null === $socialActionsAsString) {
return [];
}
return array_map(
fn(string $id): ?SocialAction => $this->om->getRepository(SocialAction::class)->findOneBy(['id' => (int) $id]),
explode(',', $socialActionsAsString)
);
}
))
;
;
}
if ($activityType->isVisible('date')) {