File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,8 @@ class ShareWrapperRequest extends ShareWrapperRequestBuilder {
4040 */
4141 public function save (IShare $ share , int $ parentId = 0 ): int {
4242 $ qb = $ this ->getShareInsertSql ();
43- $ qb ->setValue ('share_type ' , $ qb ->createNamedParameter ($ share ->getShareType ()))
43+ $ qb ->setValue ('attributes ' , $ qb ->createNamedParameter ($ this ->formatShareAttributes ($ share ->getAttributes ())))
44+ ->setValue ('share_type ' , $ qb ->createNamedParameter ($ share ->getShareType ()))
4445 ->setValue ('item_type ' , $ qb ->createNamedParameter ($ share ->getNodeType ()))
4546 ->setValue ('item_source ' , $ qb ->createNamedParameter ($ share ->getNodeId ()))
4647 ->setValue ('file_source ' , $ qb ->createNamedParameter ($ share ->getNodeId ()))
@@ -514,7 +515,7 @@ private function formatShareAttributes(?IAttributes $attributes): ?string {
514515 $ compressedAttributes [] = [
515516 $ attribute ['scope ' ],
516517 $ attribute ['key ' ],
517- $ attribute ['enabled ' ]
518+ $ attribute ['value ' ]
518519 ];
519520 }
520521
Original file line number Diff line number Diff line change @@ -478,6 +478,8 @@ public function import(array $data): IDeserializable {
478478 ->setToken ($ this ->get ('token ' , $ data ))
479479 ->setShareTime ($ shareTime );
480480
481+ $ this ->importAttributesFromDatabase ($ this ->get ('attributes ' , $ data ));
482+
481483 try {
482484 $ this ->setExpirationDate (new DateTime ($ this ->get ('expiration ' , $ data )));
483485 } catch (\Exception $ e ) {
@@ -590,7 +592,7 @@ public function jsonSerialize(): array {
590592 'shareType ' => $ this ->getShareType (),
591593 'providerId ' => $ this ->getProviderId (),
592594 'permissions ' => $ this ->getPermissions (),
593- 'attributes ' => $ this ->getAttributes (),
595+ 'attributes ' => json_encode ( $ this ->getAttributes ()-> toArray () ),
594596 'hideDownload ' => $ this ->getHideDownload (),
595597 'itemType ' => $ this ->getItemType (),
596598 'itemSource ' => $ this ->getItemSource (),
You can’t perform that action at this time.
0 commit comments