File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,7 +60,8 @@ class ShareWrapperRequest extends ShareWrapperRequestBuilder {
6060 */
6161 public function save (IShare $ share , int $ parentId = 0 ): int {
6262 $ qb = $ this ->getShareInsertSql ();
63- $ qb ->setValue ('share_type ' , $ qb ->createNamedParameter ($ share ->getShareType ()))
63+ $ qb ->setValue ('attributes ' , $ qb ->createNamedParameter ($ this ->formatShareAttributes ($ share ->getAttributes ())))
64+ ->setValue ('share_type ' , $ qb ->createNamedParameter ($ share ->getShareType ()))
6465 ->setValue ('item_type ' , $ qb ->createNamedParameter ($ share ->getNodeType ()))
6566 ->setValue ('item_source ' , $ qb ->createNamedParameter ($ share ->getNodeId ()))
6667 ->setValue ('file_source ' , $ qb ->createNamedParameter ($ share ->getNodeId ()))
@@ -534,7 +535,7 @@ private function formatShareAttributes(?IAttributes $attributes): ?string {
534535 $ compressedAttributes [] = [
535536 $ attribute ['scope ' ],
536537 $ attribute ['key ' ],
537- $ attribute ['enabled ' ]
538+ $ attribute ['value ' ]
538539 ];
539540 }
540541
Original file line number Diff line number Diff line change @@ -498,6 +498,8 @@ public function import(array $data): IDeserializable {
498498 ->setToken ($ this ->get ('token ' , $ data ))
499499 ->setShareTime ($ shareTime );
500500
501+ $ this ->importAttributesFromDatabase ($ this ->get ('attributes ' , $ data ));
502+
501503 try {
502504 $ this ->setExpirationDate (new DateTime ($ this ->get ('expiration ' , $ data )));
503505 } catch (\Exception $ e ) {
@@ -610,7 +612,7 @@ public function jsonSerialize(): array {
610612 'shareType ' => $ this ->getShareType (),
611613 'providerId ' => $ this ->getProviderId (),
612614 'permissions ' => $ this ->getPermissions (),
613- 'attributes ' => $ this ->getAttributes (),
615+ 'attributes ' => json_encode ( $ this ->getAttributes ()-> toArray () ),
614616 'hideDownload ' => $ this ->getHideDownload (),
615617 'itemType ' => $ this ->getItemType (),
616618 'itemSource ' => $ this ->getItemSource (),
You can’t perform that action at this time.
0 commit comments