Skip to content

Commit 4b203e5

Browse files
committed
fix: only skip template initialization when both skeletondirectory and templatedirectory are empty
Signed-off-by: Benjamin Frueh <benjamin.frueh@gmail.com>
1 parent c29c702 commit 4b203e5

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
@@ -194,7 +194,7 @@ public function index($dir = '', $view = '', $fileid = null) {
194194
$this->eventDispatcher->dispatchTyped(new LoadViewer());
195195
}
196196

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

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)