diff options
Diffstat (limited to 'apps/files_sharing/api/share20ocs.php')
-rw-r--r-- | apps/files_sharing/api/share20ocs.php | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/apps/files_sharing/api/share20ocs.php b/apps/files_sharing/api/share20ocs.php index 8e216c8c3c8..8d481d817ea 100644 --- a/apps/files_sharing/api/share20ocs.php +++ b/apps/files_sharing/api/share20ocs.php @@ -81,26 +81,26 @@ class Share20OCS { 'uid_owner' => $share->getSharedBy()->getUID(), 'displayname_owner' => $share->getSharedBy()->getDisplayName(), 'permissions' => $share->getPermissions(), - 'stime' => $share->getShareTime(), - 'parent' => $share->getParent(), + 'stime' => $share->getShareTime()->getTimestamp(), + 'parent' => null, 'expiration' => null, 'token' => null, 'uid_file_owner' => $share->getShareOwner()->getUID(), 'displayname_file_owner' => $share->getShareOwner()->getDisplayName(), ]; - $path = $share->getPath(); - $result['path'] = $this->rootFolder->getUserFolder($share->getShareOwner()->getUID())->getRelativePath($path->getPath()); - if ($path instanceOf \OCP\Files\Folder) { + $node = $share->getNode(); + $result['path'] = $this->rootFolder->getUserFolder($share->getShareOwner()->getUID())->getRelativePath($node->getPath()); + if ($node instanceOf \OCP\Files\Folder) { $result['item_type'] = 'folder'; } else { $result['item_type'] = 'file'; } - $result['storage_id'] = $path->getStorage()->getId(); - $result['storage'] = $path->getStorage()->getCache()->getNumericStorageId(); - $result['item_source'] = $path->getId(); - $result['file_source'] = $path->getId(); - $result['file_parent'] = $path->getParent()->getId(); + $result['storage_id'] = $node->getStorage()->getId(); + $result['storage'] = $node->getStorage()->getCache()->getNumericStorageId(); + $result['item_source'] = $node->getId(); + $result['file_source'] = $node->getId(); + $result['file_parent'] = $node->getParent()->getId(); $result['file_target'] = $share->getTarget(); if ($share->getShareType() === \OCP\Share::SHARE_TYPE_USER) { @@ -220,7 +220,7 @@ class Share20OCS { return new \OC_OCS_Result(null, 404, 'wrong path, file/folder doesn\'t exist'); } - $share->setPath($path); + $share->setNode($path); // Parse permissions (if available) $permissions = $this->request->getParam('permissions', null); |