Skip to content

Commit 74ff1c6

Browse files
authored
Merge pull request #53979 from nextcloud/fix/settings-share-folder
fix(files_sharing): ensure share folder exists in the settings
2 parents 2120a50 + f3857f7 commit 74ff1c6

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

apps/files_sharing/lib/Settings/Personal.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
namespace OCA\Files_Sharing\Settings;
1010

1111
use OCA\Files_Sharing\AppInfo\Application;
12+
use OCA\Files_Sharing\Helper;
1213
use OCP\AppFramework\Http\TemplateResponse;
1314
use OCP\AppFramework\Services\IInitialState;
1415
use OCP\IConfig;
@@ -25,16 +26,18 @@ public function __construct(
2526

2627
public function getForm(): TemplateResponse {
2728
$defaultAcceptSystemConfig = $this->config->getSystemValueBool('sharing.enable_share_accept', false) ? 'no' : 'yes';
28-
$shareFolderSystemConfig = $this->config->getSystemValue('share_folder', '/');
29+
$defaultShareFolder = $this->config->getSystemValue('share_folder', '/');
30+
$userShareFolder = Helper::getShareFolder(userId: $this->userId);
2931
$acceptDefault = $this->config->getUserValue($this->userId, Application::APP_ID, 'default_accept', $defaultAcceptSystemConfig) === 'yes';
3032
$enforceAccept = $this->config->getSystemValueBool('sharing.force_share_accept', false);
3133
$allowCustomDirectory = $this->config->getSystemValueBool('sharing.allow_custom_share_folder', true);
32-
$shareFolderDefault = $this->config->getUserValue($this->userId, Application::APP_ID, 'share_folder', $shareFolderSystemConfig);
34+
3335
$this->initialState->provideInitialState('accept_default', $acceptDefault);
3436
$this->initialState->provideInitialState('enforce_accept', $enforceAccept);
3537
$this->initialState->provideInitialState('allow_custom_share_folder', $allowCustomDirectory);
36-
$this->initialState->provideInitialState('share_folder', $shareFolderDefault);
37-
$this->initialState->provideInitialState('default_share_folder', $shareFolderSystemConfig);
38+
$this->initialState->provideInitialState('default_share_folder', $defaultShareFolder);
39+
$this->initialState->provideInitialState('share_folder', $userShareFolder);
40+
3841
return new TemplateResponse('files_sharing', 'Settings/personal');
3942
}
4043

0 commit comments

Comments
 (0)