From c412f2ab72c929d2f98823bf43733c81e56c03a4 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Mon, 14 Apr 2025 14:49:55 +0200 Subject: [PATCH] fix(files_sharing): do not show download button if `hide-download` is enabled Signed-off-by: Ferdinand Thiessen --- apps/files_sharing/lib/DefaultPublicShareTemplateProvider.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/files_sharing/lib/DefaultPublicShareTemplateProvider.php b/apps/files_sharing/lib/DefaultPublicShareTemplateProvider.php index 0c76f0e1742..b6639332622 100644 --- a/apps/files_sharing/lib/DefaultPublicShareTemplateProvider.php +++ b/apps/files_sharing/lib/DefaultPublicShareTemplateProvider.php @@ -146,7 +146,7 @@ class DefaultPublicShareTemplateProvider implements IPublicShareTemplateProvider // Create the header action menu $headerActions = []; - if ($view !== 'public-file-drop') { + if ($view !== 'public-file-drop' && !$share->getHideDownload()) { // The download URL is used for the "download" header action as well as in some cases for the direct link $downloadUrl = $this->urlGenerator->linkToRouteAbsolute('files_sharing.sharecontroller.downloadShare', [ 'token' => $token, @@ -157,7 +157,7 @@ class DefaultPublicShareTemplateProvider implements IPublicShareTemplateProvider $headerActions[] = new SimpleMenuAction('download', $this->l10n->t('Download'), 'icon-download', $downloadUrl, 0, (string)$shareNode->getSize()); // If remote sharing is enabled also add the remote share action to the menu - if ($this->federatedShareProvider->isOutgoingServer2serverShareEnabled() && !$share->getHideDownload()) { + if ($this->federatedShareProvider->isOutgoingServer2serverShareEnabled()) { $headerActions[] = new ExternalShareMenuAction( // TRANSLATORS The placeholder refers to the software product name as in 'Add to your Nextcloud' $this->l10n->t('Add to your %s', [$this->defaults->getProductName()]),