diff --git a/CHANGELOG.md b/CHANGELOG.md index 49943e927..5ea16e7fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to ## Unreleased +* [Documents] Validate storedObject and allow for null data (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/565) +* [Activity form] invert 'incoming' and 'receiving' in Activity form +* [Activity form] keep the same order for 'attendee' field in new and edit form +* [list with period] use "sameas" test operator to introduce requestor in list ## Test releases diff --git a/src/Bundle/ChillActivityBundle/Entity/Activity.php b/src/Bundle/ChillActivityBundle/Entity/Activity.php index eabaa44d1..0c0632722 100644 --- a/src/Bundle/ChillActivityBundle/Entity/Activity.php +++ b/src/Bundle/ChillActivityBundle/Entity/Activity.php @@ -35,6 +35,7 @@ use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Serializer\Annotation\DiscriminatorMap; use Symfony\Component\Serializer\Annotation\Groups; use Symfony\Component\Serializer\Annotation\SerializedName; +use Symfony\Component\Validator\Constraints as Assert; /** * Class Activity. @@ -93,6 +94,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac /** * @ORM\ManyToMany(targetEntity="Chill\DocStoreBundle\Entity\StoredObject", cascade={"persist"}) + * @Assert\Valid(traverse=true) */ private Collection $documents; diff --git a/src/Bundle/ChillDocStoreBundle/Entity/StoredObject.php b/src/Bundle/ChillDocStoreBundle/Entity/StoredObject.php index c309fab72..56380ec74 100644 --- a/src/Bundle/ChillDocStoreBundle/Entity/StoredObject.php +++ b/src/Bundle/ChillDocStoreBundle/Entity/StoredObject.php @@ -149,37 +149,37 @@ class StoredObject implements AsyncFileInterface, Document return $this; } - public function setDatas(array $datas) + public function setDatas(?array $datas) { - $this->datas = $datas; + $this->datas = (array) $datas; return $this; } - public function setFilename($filename) + public function setFilename(?string $filename) { - $this->filename = $filename; + $this->filename = (string) $filename; return $this; } - public function setIv(array $iv) + public function setIv(?array $iv) { - $this->iv = $iv; + $this->iv = (array) $iv; return $this; } - public function setKeyInfos(array $keyInfos) + public function setKeyInfos(?array $keyInfos) { - $this->keyInfos = $keyInfos; + $this->keyInfos = (array) $keyInfos; return $this; } - public function setType(string $type) + public function setType(?string $type) { - $this->type = $type; + $this->type = (string) $type; return $this; } diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationDocument.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationDocument.php index b31225df1..cf3fb8a9f 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationDocument.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationDocument.php @@ -20,6 +20,7 @@ use DateTimeInterface; use Doctrine\ORM\Mapping as ORM; use RuntimeException; use Symfony\Component\Serializer\Annotation as Serializer; +use Symfony\Component\Validator\Constraints as Assert; /** * @ORM\Entity @@ -88,6 +89,7 @@ class AccompanyingPeriodWorkEvaluationDocument implements \Chill\MainBundle\Doct * @Serializer\Groups({"read"}) * @Serializer\Groups({"write"}) * @Serializer\Groups({"accompanying_period_work_evaluation:create"}) + * @Assert\Valid */ private ?StoredObject $storedObject = null;