From 3f475035286ff4022100184561c8dfa5a24115d1 Mon Sep 17 00:00:00 2001 From: nobohan Date: Tue, 26 Apr 2022 11:53:17 +0200 Subject: [PATCH] storedObject: allow for null data in storedObject --- CHANGELOG.md | 4 +++- .../Entity/StoredObject.php | 20 +++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f7c1c3d1f..3b54facb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ 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 @@ -24,7 +26,7 @@ and this project adheres to * [Accompanying period work evaluations] list documents associated to a work by creation date, and then by id, from the most recent to older * [Course comment] add validationConstraint NotNull and NotBlank on comment content, to avoid sql error * [Notifications] delay the sending of notificaiton to kernel.terminate -* [Notifications / Period user change] fix the sending of notification when user changes +* [Notifications / Period user change] fix the sending of notification when user changes ## Test releases diff --git a/src/Bundle/ChillDocStoreBundle/Entity/StoredObject.php b/src/Bundle/ChillDocStoreBundle/Entity/StoredObject.php index 78387e7fe..86bc930c6 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($iv) + public function setIv(?array $iv) { - $this->iv = $iv; + $this->iv = (array) $iv; return $this; } - public function setKeyInfos($keyInfos) + public function setKeyInfos(?array $keyInfos) { - $this->keyInfos = $keyInfos; + $this->keyInfos = (array) $keyInfos; return $this; } - public function setType($type) + public function setType(?string $type) { - $this->type = $type; + $this->type = (string) $type; return $this; }