Skip to content

Commit 8746f2b

Browse files
benjaminfruehelzody
authored andcommitted
fix: only skip template initialization when both skeletondirectory and templatedirectory are empty
Signed-off-by: Benjamin Frueh <benjamin.frueh@gmail.com>
1 parent 29f78e2 commit 8746f2b

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
@@ -202,7 +202,7 @@ public function index($dir = '', $view = '', $fileid = null) {
202202
$this->eventDispatcher->dispatchTyped(new LoadViewer());
203203
}
204204

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

lib/private/Files/Template/TemplateManager.php

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

337-
if ($skeletonTemplatePath === '') {
337+
if ($path === null && $skeletonTemplatePath === '' && $skeletonPath === '') {
338338
$this->setTemplatePath('');
339339
return '';
340340
}

0 commit comments

Comments
 (0)