server icon indicating copy to clipboard operation
server copied to clipboard

[Bug]: Document templates broken

Open schiessle opened this issue 8 months ago • 8 comments

⚠️ This issue respects the following points: ⚠️

Bug description

Create a new office document or text document in Nextcloud. The document creation dialog only ask for the filename but doesn't let me chose one of the Templates from the "Templates" folder

Happens to me on c.nc.com. On a fresh setup LTD it seems to work but this is also a older version (30.0.10) while c.cn.com runs on 31.0.4

Steps to reproduce

  1. Make sure to have a "Templates" folder with some templates
  2. Create a new document
  3. You get only asked for a filename:

Image

Expected behavior

I can chose a Template for the new document

Nextcloud Server version

31

Operating system

None

PHP engine version

None

Web server

None

Database engine version

None

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

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

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

Configuration report


List of activated Apps


Nextcloud Signing status


Nextcloud Logs


Additional info

No response

schiessle avatar Apr 30 '25 13:04 schiessle

I also tried to delete and re-create the "Templates" folder with the Nextcloud file manager. No improvements.

But what I don't have is the "create new template folder" option in the "New" menu, which might be a way to solve the problem.

schiessle avatar Apr 30 '25 13:04 schiessle

cc @juliusknorr

susnux avatar Apr 30 '25 14:04 susnux

Are you sure it never lets you select a template? There is an issue where the template picker takes a reeeally long time to appear the first time you open it, but that is being worked on. I was not able to reproduce this on c.nc.com, so try waiting a bit to see if picker dialog appears? Otherwise, maybe a screen recording or browser logs or something would help.

elzody avatar May 01 '25 18:05 elzody

I'm seeing exactly the same on several of my instances. On one instance which I recently set up, it works, but on the older ones it does not, which lets me suspect that some switch in the database is missing, because this feature isn't that old.

vasyugan avatar May 04 '25 21:05 vasyugan

Are you sure it never lets you select a template? There is an issue where the template picker takes a reeeally long time to appear the first time you open it, but that is being worked on. I was not able to reproduce this on c.nc.com, so try waiting a bit to see if picker dialog appears? Otherwise, maybe a screen recording or browser logs or something would help.

I have two Nextcloud AIO instances, one is a fresh install where everything works as expected. Another is migrated from a native install. There it reproducibly does NOT work. the whiteboard app for instance immediately shows an empty canvas, Collabora immediately opens a new empty table/document etc instead of presenting me with the picker first. On both instances, the contents of the templates folder are identical and on both instances, the folder is chosen as the templates folder for Nextcloud Office.

P.S.: Until recently, when I set up a new instance, I wasn't even aware that there is a template picker, because on those old nextcloud instances it just never shows up (again, "old" means that the initial setup was done long ago, not the the nextcloud server or the apps are old. They are all updated to the very latest versions).

vasyugan avatar May 04 '25 21:05 vasyugan

Do check browser console log when you create a file. I have had cases where a broken template breaks the picker.

small1 avatar May 05 '25 06:05 small1

Now I have found that on the same instance, some users are affected why others are not. The difference is that those who are affected lack an entry "templateDirectory" in the table oc_preferences. This doesn't seem to be the same as the "templateFolder", which can be changed from the settings, which according to the interface affects Nextcloud office, but in reality, for those affected users makes no difference.

vasyugan avatar May 05 '25 06:05 vasyugan

So, I've verified: adding a "templateDirectory" line in oc_preferences for the affected user fixes it for me: In postgres for instance I do:

INSERT INTO oc_preferences (userid, appid, configkey, configvalue)
VALUES ('someuser', 'core', 'templateDirectory', 'Vorlagen');

This cannot be changed from the settings window, unfortunately, so this is clearly a bug.

And the picker is extremely slow on non AIO instances and sometimes, the selection of a template has no effect, e.g. the whiteboard still presents an empty canvas.

vasyugan avatar May 05 '25 06:05 vasyugan