Skip to content

Commit 047a758

Browse files
authored
Merge pull request #58786 from nextcloud/fix/templates_enabled
fix(files): only disable template creation when both skeleton directories are empty
2 parents 9e9cccd + 4b203e5 commit 047a758

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

apps/files/lib/Controller/ViewController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public function index($dir = '', $view = '', $fileid = null) {
198198
$this->eventDispatcher->dispatchTyped(new LoadViewer());
199199
}
200200

201-
$this->initialState->provideInitialState('templates_enabled', ($this->config->getSystemValueString('skeletondirectory', \OC::$SERVERROOT . '/core/skeleton') !== '') || ($this->config->getSystemValueString('templatedirectory', \OC::$SERVERROOT . '/core/skeleton/Templates') !== ''));
201+
$this->initialState->provideInitialState('templates_enabled', true);
202202
$this->initialState->provideInitialState('templates_path', $this->templateManager->hasTemplateDirectory() ? $this->templateManager->getTemplatePath() : false);
203203
$this->initialState->provideInitialState('templates', $this->templateManager->listCreators());
204204

lib/private/Files/Template/TemplateManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ public function initializeTemplateDirectory(?string $path = null, ?string $userI
328328
$isDefaultTemplates = $skeletonTemplatePath === $defaultTemplateDirectory;
329329
$userLang = $this->l10nFactory->getUserLanguage($this->userManager->get($this->userId));
330330

331-
if ($skeletonTemplatePath === '') {
331+
if ($path === null && $skeletonTemplatePath === '' && $skeletonPath === '') {
332332
$this->setTemplatePath('');
333333
return '';
334334
}

0 commit comments

Comments
 (0)