diff --git a/lib/Model/ShareWrapper.php b/lib/Model/ShareWrapper.php index c08c75fa5..5ac33d322 100644 --- a/lib/Model/ShareWrapper.php +++ b/lib/Model/ShareWrapper.php @@ -498,6 +498,8 @@ public function import(array $data): IDeserializable { ->setToken($this->get('token', $data)) ->setShareTime($shareTime); + $this->importAttributesFromDatabase($this->get('attributes', $data)); + try { $this->setExpirationDate(new DateTime($this->get('expiration', $data))); } catch (\Exception $e) { @@ -610,7 +612,7 @@ public function jsonSerialize(): array { 'shareType' => $this->getShareType(), 'providerId' => $this->getProviderId(), 'permissions' => $this->getPermissions(), - 'attributes' => $this->getAttributes(), + 'attributes' => json_encode($this->getAttributes()->toArray()), 'hideDownload' => $this->getHideDownload(), 'itemType' => $this->getItemType(), 'itemSource' => $this->getItemSource(),