-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
fix(files): only disable template creation when both skeleton directories are empty #58786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 === '') { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is $path also checked now?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
| $this->setTemplatePath(''); | ||
| return ''; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will make the button appear even if it may do nothing?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my tests the button always works correctly even if both configurations are empty. It manually creates a template directory in the users directory and is only available for users who don't have a template directory configured yet.
This wasn't working before because the condition in
initializeTemplateDirectorywas blocking it even when coming from a manual user request, not from the automatic initialization on new user setup.The change was originally implemented to prevent the automatic creation of the template folder, the manual creation is a feature a user could always opt-in and use.
So in my opinion the manual creation could always be possible regardless of both configurations. If the nextcloud configurated
templatedirectoryis a empty string, no files will be seeded automatically from there, but the user can still create it and add their own templates to it.