-
Notifications
You must be signed in to change notification settings - Fork 117
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
Global templates cannot be added #3473
Comments
Do you have an example file that shows this issue that you could share maybe? |
The check generating that warning is performed based on mime types. We look at both the extension (to match to distributed as well as locally added mime type mappings) as well as, if necessary, the content to determine the file's mime type. The ones we accept are: richdocuments/lib/TemplateManager.php Lines 68 to 86 in 18afa57
Extension takes precedence over content as long as the extension is listed in the mime type mappings. The file you've uploaded is listed in the default maps: And seems to match here: richdocuments/lib/TemplateManager.php Line 70 in 18afa57
Unclear why this wouldn't work. Have you done any local mime type mappings customizations by chance? EDIT: (below)
This likely works because it bypasses the mime checks. It does validate your template is otherwise valid (assuming your template works for real after adding it this way). So this comes back to maybe your mime types being incomplete or some previously unknown bug here that merely causes our sanity checks to fail. |
Describe the bug
When you go to global template section and choose a template via the + icon: it acknowledged with error message: An error occurred: Only template files can be uploaded
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The template is chooseable and display in the list global templates
Screenshots
Client details:
Server details
Operating system: Linux 5.10.0-27-amd64 #1 SMP Debian 5.10.205-2 (2023-12-31) x86_64
Webserver: Apache (cgi-fcgi)
Database: mysql 10.5.23
PHP version: 8.1.27
Modules loaded: Core, date, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dba, dom, hash, fileinfo, filter, ftp, gd, gettext, gmp, json, htscanner, iconv, SPL, intl, session, ldap, mbstring, mcrypt, standard, mysqlnd, OAuth, pcntl, exif, mysqli, PDO, pdo_dblib, PDO_Firebird, pdo_mysql, PDO_ODBC, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, readline, redis, Reflection, imap, shmop, SimpleXML, soap, sockets, sodium, ssh2, sysvmsg, sysvsem, sysvshm, tidy, timezonedb, tokenizer, xml, xmlreader, xmlwriter, xsl, zip, cgi-fcgi, imagick, apcu, Zend OPcache
Nextcloud version: 28.0.2 - 28.0.2.5
Updated from an older Nextcloud/ownCloud or fresh install:
Where did you install Nextcloud from: unknown
Signing status
Nextcloud log (data/nextcloud.log)
Browser log
Possible workaround: put your template into nextcloud/appdata_ocu20xefurkh/richdocuments/templates
Then run
occ files:scan-app-data
The text was updated successfully, but these errors were encountered: