Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hideDownload ignored in createShare #19484

Closed
sodiumchl opened this issue Feb 14, 2020 · 8 comments · Fixed by #19914
Closed

hideDownload ignored in createShare #19484

sodiumchl opened this issue Feb 14, 2020 · 8 comments · Fixed by #19914

Comments

@sodiumchl
Copy link

Nextcloud version 18.0
in file lib/private/Share20/Manager.php
692: public function createShare(\OCP\Share\IShare $share)
$share->hideDownload is ignored.

To reproduce:
$share = $this->shareManager->newShare();
$share->setSharedBy($userId);
$share->setNode($node);
$share->setShareType(Share::SHARE_TYPE_LINK);
$share->setHideDownload(true); //or 1
$this->shareManager->createShare($share);
The created share has hideDownload uncheck as seen in the GUI

@sodiumchl sodiumchl added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Feb 14, 2020
@kesselb
Copy link
Contributor

kesselb commented Feb 14, 2020

cc @rullzer

@sodiumchl
Copy link
Author

This does not set hideDownload to true either:
$check = $this->shareManager->getShareByToken($token);
if (is_null($check)) return 'Error';
$check->setHideDownload(true);
return $token;

@sodiumchl
Copy link
Author

sodiumchl commented Feb 14, 2020

And this does not set hide_download to 1 either:
curl -u ... -H ... -d 'hide_download=1' -X PUT 'https://my.doma.in/ocs/v2.php/apps/files_sharing/api/v1/shares/sid'

@wiswedel
Copy link
Contributor

Even if you set [oc_share].[hide_download] manually to 1 in the database, the checkbox stays unchecked and the download button remains visible and functional on the share.

@wiswedel
Copy link
Contributor

This only applies to email shares. Link shares are working fine.

Reproduced with 18.0.1

@wiswedel
Copy link
Contributor

cc @nextcloud/server-triage (security)

@skjnldsv
Copy link
Member

This only applies to email shares. Link shares are working fine.

Reproduced with 18.0.1

Most likely due to the merge of mail link shares and link shares

@rullzer rullzer self-assigned this Mar 12, 2020
@rullzer
Copy link
Member

rullzer commented Mar 12, 2020

Got it. PR incomming

rullzer added a commit that referenced this issue Mar 12, 2020
fixes #19484

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
rullzer added a commit that referenced this issue Mar 13, 2020
fixes #19484

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
@wiswedel wiswedel added 3. to review Waiting for reviews and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Mar 13, 2020
backportbot-nextcloud bot pushed a commit that referenced this issue Mar 13, 2020
fixes #19484

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
@rullzer rullzer added this to the Nextcloud 19 milestone Mar 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants