owncloud / owncloud/ocis

Shares users and group in non-root folder don't receive the correct path

Open
#9,746 0 comments 0 reactions 0 assignees View on GitHub
Type:Bug
Dominant language
Go
Stars
2.1k
Forks
274
Avg merge
2d 1h
Merged PRs (30d)
103

Description

## Describe the bug

When the next curl is executed, a share is created on an image that is not in root:

```
curl -H 'accept: */*' -H 'content-type: application/x-www-form-urlencoded' -H 'accept-language: en' -H 'original-request-id: C8FB77A6-0859-46B4-855E-1547E1DA4029' -H 'authorization: Bearer --compressed -X POST
https://demo.owncloud.com/ocs/v2.php/apps/files_sharing/api/v1/shares
-d 'path=/Test/IMG_20190211_092023.jpg&shareType=0&permissions=3&space_ref=166d1210-cdb9-50ab-9f1e-ecb9ef12a304$4c510ada-c86b-4815-8820-42cdf82c3d51!325f5e63-4c76-471f-9347-95b8987790de&shareWith=katherine'
```

The problem is we received a wrong `path` when we are in a non-root file.

With that request, the expected path in the response would be:
`/Test/IMG_20190211_092023.jpg
`

The current `path` is:
`/IMG_20190211_092023.jpg`

This causes that when a file is shared with Users and group, the new share is not directly displayed on the screen. The full `path` must be provided.

I link the pr where we are dealing with this problem in Android: https://github.com/owncloud/android/pull/4435

## Expected behavior
We should receive the full path.

## Actual behavior
We receive the path how if we were in a root folder.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.