Skip to content

Commit e603333

Browse files
authored
Merge pull request #53998 from nextcloud/backport/53979/stable30
[stable30] fix(files_sharing): ensure share folder exists in the settings
2 parents 0403843 + 06487a5 commit e603333

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

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;
@@ -31,16 +32,18 @@ public function __construct(IConfig $config, IInitialState $initialState, string
3132

3233
public function getForm(): TemplateResponse {
3334
$defaultAcceptSystemConfig = $this->config->getSystemValueBool('sharing.enable_share_accept', false) ? 'no' : 'yes';
34-
$shareFolderSystemConfig = $this->config->getSystemValue('share_folder', '/');
35+
$defaultShareFolder = $this->config->getSystemValue('share_folder', '/');
36+
$userShareFolder = Helper::getShareFolder(userId: $this->userId);
3537
$acceptDefault = $this->config->getUserValue($this->userId, Application::APP_ID, 'default_accept', $defaultAcceptSystemConfig) === 'yes';
3638
$enforceAccept = $this->config->getSystemValueBool('sharing.force_share_accept', false);
3739
$allowCustomDirectory = $this->config->getSystemValueBool('sharing.allow_custom_share_folder', true);
38-
$shareFolderDefault = $this->config->getUserValue($this->userId, Application::APP_ID, 'share_folder', $shareFolderSystemConfig);
40+
3941
$this->initialState->provideInitialState('accept_default', $acceptDefault);
4042
$this->initialState->provideInitialState('enforce_accept', $enforceAccept);
4143
$this->initialState->provideInitialState('allow_custom_share_folder', $allowCustomDirectory);
42-
$this->initialState->provideInitialState('share_folder', $shareFolderDefault);
43-
$this->initialState->provideInitialState('default_share_folder', $shareFolderSystemConfig);
44+
$this->initialState->provideInitialState('default_share_folder', $defaultShareFolder);
45+
$this->initialState->provideInitialState('share_folder', $userShareFolder);
46+
4447
return new TemplateResponse('files_sharing', 'Settings/personal');
4548
}
4649

0 commit comments

Comments
 (0)