Only create template directory if it is present in the default skeleton

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2021-01-26 21:32:23 +01:00
parent 4f90766ba3
commit 0111381529
No known key found for this signature in database
GPG key ID: 4C614C6ED2CDE6DF

View file

@ -256,7 +256,10 @@ class TemplateManager implements ITemplateManager {
// Initial user setup without a provided path
if ($path === null) {
// All locations are default so we just need to rename the directory to the users language
if ($isDefaultSkeleton && $isDefaultTemplates && $userFolder->nodeExists('Templates')) {
if ($isDefaultSkeleton && $isDefaultTemplates) {
if (!$userFolder->nodeExists('Templates')) {
return '';
}
$newPath = $userFolder->getPath() . '/' . $userTemplatePath;
if ($newPath !== $userFolder->get('Templates')->getPath()) {
$userFolder->get('Templates')->move($newPath);