diff --git a/apps/files/lib/Controller/ViewController.php b/apps/files/lib/Controller/ViewController.php index ecf21cef313ac..48c7fc7dd9c3a 100644 --- a/apps/files/lib/Controller/ViewController.php +++ b/apps/files/lib/Controller/ViewController.php @@ -194,7 +194,7 @@ public function index($dir = '', $view = '', $fileid = null) { $this->eventDispatcher->dispatchTyped(new LoadViewer()); } - $this->initialState->provideInitialState('templates_enabled', ($this->config->getSystemValueString('skeletondirectory', \OC::$SERVERROOT . '/core/skeleton') !== '') || ($this->config->getSystemValueString('templatedirectory', \OC::$SERVERROOT . '/core/skeleton/Templates') !== '')); + $this->initialState->provideInitialState('templates_enabled', true); $this->initialState->provideInitialState('templates_path', $this->templateManager->hasTemplateDirectory() ? $this->templateManager->getTemplatePath() : false); $this->initialState->provideInitialState('templates', $this->templateManager->listCreators()); diff --git a/lib/private/Files/Template/TemplateManager.php b/lib/private/Files/Template/TemplateManager.php index 8d33e7ebb1758..d965a41957ad4 100644 --- a/lib/private/Files/Template/TemplateManager.php +++ b/lib/private/Files/Template/TemplateManager.php @@ -328,7 +328,7 @@ public function initializeTemplateDirectory(?string $path = null, ?string $userI $isDefaultTemplates = $skeletonTemplatePath === $defaultTemplateDirectory; $userLang = $this->l10nFactory->getUserLanguage($this->userManager->get($this->userId)); - if ($skeletonTemplatePath === '') { + if ($path === null && $skeletonTemplatePath === '' && $skeletonPath === '') { $this->setTemplatePath(''); return ''; }