fix: only skip template initialization when both skeletondirectory and templatedirectory are empty

Signed-off-by: Benjamin Frueh <benjamin.frueh@gmail.com>
pull/59750/head
Benjamin Frueh 3 months ago committed by Elizabeth Danzberger
parent cdcd40d58f
commit bfe5df94dc
No known key found for this signature in database
GPG Key ID: 6B466A21DF5E753C
  1. 2
      apps/files/lib/Controller/ViewController.php
  2. 2
      lib/private/Files/Template/TemplateManager.php

@ -202,7 +202,7 @@ class ViewController extends Controller {
$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());

@ -334,7 +334,7 @@ class TemplateManager implements ITemplateManager {
$isDefaultTemplates = $skeletonTemplatePath === $defaultTemplateDirectory;
$userLang = $this->l10nFactory->getUserLanguage($this->userManager->get($this->userId));
if ($skeletonTemplatePath === '') {
if ($path === null && $skeletonTemplatePath === '' && $skeletonPath === '') {
$this->setTemplatePath('');
return '';
}

Loading…
Cancel
Save