Skip to content
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

[Bug]: Emtpy Templates folder is created even with 'templatedirectory' => '' #39227

Closed
5 of 8 tasks
deiansp opened this issue Jul 7, 2023 · 8 comments
Closed
5 of 8 tasks
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap

Comments

@deiansp
Copy link

deiansp commented Jul 7, 2023

⚠️ This issue respects the following points: ⚠️

Bug description

Hi,

I'm using a custom skeleton folder. In my config file, I have:

'skeletondirectory' => '/home/nextcloud/skeleton',
'templatedirectory' => '',

When new users are created, they receive by default the files from the above skeleton folder.
But in addition, they receive also an empty folder called "Templates".

This "Templates" folder is not in my skeleton folder and the users should not have it by default.
I've tried all these options (with the same result):

'templatedirectory' => '',
'templatedirectory' => ' ',
'templatedirectory' => NULL,
'templatedirectory' => false,
// 'templatedirectory' => '',

Steps to reproduce

  1. Add in the config file 'templatedirectory' => '',
  2. Create a new user
  3. Login as this user and you'll see an empty "Templates" folder

Expected behavior

The user should not see an empty "Templates" folder if 'templatedirectory' => '', is set in the config file.

Installation method

Community Web installer on a VPS or web space

Nextcloud Server version

27

Operating system

RHEL/CentOS

PHP engine version

PHP 8.2

Web server

Apache (supported)

Database engine version

MySQL

Is this bug present after an update or on a fresh install?

Fresh Nextcloud Server install

Are you using the Nextcloud Server Encryption module?

Encryption is Enabled

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

@deiansp deiansp added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Jul 7, 2023
@deiansp
Copy link
Author

deiansp commented Jul 7, 2023

The previous discussion was here: #27890
The problem still exists in 27.

@mcmara
Copy link

mcmara commented Jul 7, 2023

Confirming this bug. Note that if the configuration file contains only this line:

'skeletondirectory' => '',

then the "Templates" folder is not being created.
Instead, if skeletondirectory is set to something such as:

'skeletondirectory' => '/www/data/iros-2023/skeleton',

then the empty "Templates" folder appears. Third case:

'skeletondirectory' => '/www/data/iros-2023/skeleton',
'templatedirectory' => '',

also the empty "Templates" folder is being created.

@szaimen
Copy link
Contributor

szaimen commented Jul 10, 2023

cc @nextcloud/server-backend @juliushaertl

@skjnldsv
Copy link
Member

skjnldsv commented Jul 10, 2023

This is part of the documentation

If this is not set creating a template directory will only happen if no custom skeletondirectory is defined, otherwise the shipped templates will be used to create a template directory for the user.

/**
* The directory where the template files are located. These files will be
* copied to the template directory of new users. Leave empty to not copy any
* template files.
* ``{lang}`` can be used as a placeholder for the language of the user.
* If the directory does not exist, it falls back to non dialect (from ``de_DE``
* to ``de``). If that does not exist either, it falls back to ``default``
*
* If this is not set creating a template directory will only happen if no custom
* ``skeletondirectory`` is defined, otherwise the shipped templates will be used
* to create a template directory for the user.
*/
'templatedirectory' => '/path/to/nextcloud/templates',

@deiansp
Copy link
Author

deiansp commented Jul 10, 2023

I have created a feature request: #39266
Thank you!

@x-merlin-x
Copy link

I have created a feature request: #39266 Thank you!

Appreciated, however this looks more like a bug to me. Or is there any use to this folder? What if the skeleton folder contains a directory with the same name because somebody wants to ship file templates during account creation?
This behaviour is confusing.

@AndrinS
Copy link

AndrinS commented Mar 5, 2024

The order of those two parameter seem to play a role.

'skeletondirectory' => '/www/data/iros-2023/skeleton',
'templatedirectory' => '',

Template folder is created.

'templatedirectory' => '',
'skeletondirectory' => '/www/data/iros-2023/skeleton',

Template folder is not created.

@come-nc
Copy link
Contributor

come-nc commented Mar 5, 2024

It is highly unlikely that the order of the parameters in the array change anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap
Projects
None yet
Development

No branches or pull requests

7 participants