quick fixes to make calendar app work

This commit is contained in:
2022-05-09 18:01:09 +02:00
parent 0ec0708807
commit f4b1a25a67
3 changed files with 41 additions and 21 deletions

View File

@@ -131,6 +131,9 @@ class CalendarType extends AbstractType
return implode(',', $personIds);
},
function (?string $personsAsString): array {
if (null === $personsAsString) {
return [];
}
return array_map(
fn (string $id): ?Person => $this->om->getRepository(Person::class)->findOneBy(['id' => (int) $id]),
explode(',', $personsAsString)
@@ -151,6 +154,9 @@ class CalendarType extends AbstractType
return implode(',', $thirdpartyIds);
},
function (?string $thirdpartyAsString): array {
if (null === $thirdpartyAsString) {
return [];
}
return array_map(
fn (string $id): ?ThirdParty => $this->om->getRepository(ThirdParty::class)->findOneBy(['id' => (int) $id]),
explode(',', $thirdpartyAsString)
@@ -230,6 +236,7 @@ class CalendarType extends AbstractType
public function getBlockPrefix()
{
return 'chill_calendarbundle_calendar';
// as the js share some hardcoded items from activity, we have to rewrite block prefix
return 'chill_activitybundle_activity';
}
}