From f665870c4f0cc70edbc824519d40f47773a9c017 Mon Sep 17 00:00:00 2001 From: nielsranosch Date: Wed, 26 Sep 2018 17:48:47 +0200 Subject: [PATCH] Fixes for link shares When creating a link share ('shareType' => 3), 'shareWith' is optional (in fact, the parameter will be ignored if given). Additionally, 'expireDate' is not only available when updating a share, but also when creating one. The server processes and stores it correctly. Tested on NextCloud 14.0.1 --- src/NextcloudApiWrapper/SharesClient.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/NextcloudApiWrapper/SharesClient.php b/src/NextcloudApiWrapper/SharesClient.php index bfc358b..145cc54 100644 --- a/src/NextcloudApiWrapper/SharesClient.php +++ b/src/NextcloudApiWrapper/SharesClient.php @@ -57,12 +57,13 @@ public function createShare(array $params) { $params = $this->resolve($params, function(OptionsResolver $resolver) { $resolver->setRequired([ 'path', - 'shareType', - 'shareWith' + 'shareType' ])->setDefaults([ + 'shareWith' => null, 'publicUpload' => null, 'password' => null, - 'permissions' => null + 'permissions' => null, + 'expireDate' => null ]); }); @@ -94,4 +95,4 @@ public function updateShare($shareid, $key, $value) { $key => $value ]); } -} \ No newline at end of file +}