Skip to content

Commit 76b5121

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 38b38c3 commit 76b5121

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
@@ -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)