diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php
index c116c5d35..1dae24464 100644
--- a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php
+++ b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php
@@ -209,14 +209,14 @@ class ActivityController extends AbstractController
throw $this->createNotFoundException('Template not found');
}
- $activity_json = $this->serializer->serialize($entity, 'json', ['groups' => 'read']);
+ $activity_array = $this->serializer->normalize($entity, 'json', ['groups' => 'read']);
return $this->render($view, [
'person' => $person,
'accompanyingCourse' => $accompanyingPeriod,
'entity' => $entity,
'form' => $form->createView(),
- 'activity_json' => $activity_json
+ 'activity_json' => $activity_array
]);
}
@@ -323,7 +323,7 @@ class ActivityController extends AbstractController
throw $this->createNotFoundException('Template not found');
}
- $activity_json = $this->serializer->serialize($entity, 'json', ['groups' => ['read']]);
+ $activity_array = $this->serializer->normalize($entity, 'json', ['groups' => 'read']);
return $this->render($view, array(
'entity' => $entity,
@@ -331,7 +331,7 @@ class ActivityController extends AbstractController
'delete_form' => $deleteForm->createView(),
'person' => $person,
'accompanyingCourse' => $accompanyingPeriod,
- 'activity_json' => $activity_json
+ 'activity_json' => $activity_array
));
}
diff --git a/src/Bundle/ChillActivityBundle/Entity/Activity.php b/src/Bundle/ChillActivityBundle/Entity/Activity.php
index 0b35d961e..5834cd7cd 100644
--- a/src/Bundle/ChillActivityBundle/Entity/Activity.php
+++ b/src/Bundle/ChillActivityBundle/Entity/Activity.php
@@ -34,6 +34,7 @@ use Chill\MainBundle\Entity\HasScopeInterface;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\ArrayCollection;
use Chill\MainBundle\Validator\Constraints\Entity\UserCircleConsistency;
+use Symfony\Component\Serializer\Annotation\Groups;
/**
* Class Activity
@@ -61,6 +62,7 @@ class Activity implements HasCenterInterface, HasScopeInterface
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
+ * @Groups({"read"})
*/
private ?int $id;
@@ -121,11 +123,13 @@ class Activity implements HasCenterInterface, HasScopeInterface
/**
* @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\Person")
+ * @Groups({"read"})
*/
private Collection $persons;
/**
* @ORM\ManyToMany(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty")
+ * @Groups({"read"})
*/
private Collection $thirdParties;
@@ -136,6 +140,7 @@ class Activity implements HasCenterInterface, HasScopeInterface
/**
* @ORM\ManyToMany(targetEntity="Chill\MainBundle\Entity\User")
+ * @Groups({"read"})
*/
private Collection $users;
diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/editPerson.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/editPerson.html.twig
index b0cfa13c2..733912375 100644
--- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/editPerson.html.twig
+++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/editPerson.html.twig
@@ -29,7 +29,7 @@
{{ encore_entry_script_tags('vue_activity') }}
{% endblock %}
diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/newPerson.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/newPerson.html.twig
index 335b986c7..84f3f5ac3 100644
--- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/newPerson.html.twig
+++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/newPerson.html.twig
@@ -13,7 +13,7 @@
{{ encore_entry_script_tags('vue_activity') }}
{% endblock %}