Error when opening an office document with office online over an public link
Closed this issue · 4 comments
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github OR Nextcloud Community Forum (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- I agree to follow Nextcloud's Code of Conduct.
Bug description
When someone is opening an Office document via Nextcloud public link and Office Online integration they get this error:
Call to undefined method OCP\AppFramework\Http\ContentSecurityPolicy::allowInlineScript() in file '/var/www/nextcloud/apps/officeonline/lib/Controller/DocumentController.php' line 384
In that line you can find only this:
$policy->allowInlineScript(true);
Steps to reproduce
- Create an folder and put an Office file in it
- Share this folder with a public link allow upload and editing. That links is password protected and has an expiration date.
Expected behavior
The file should be opening with Office Online.
Installation method
Other Community project
Nextcloud Server version
28
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.1
Web server
Apache (supported)
Database engine version
MySQL
Is this bug present after an update or on a fresh install?
Updated from a MINOR version (ex. 22.1 to 22.2)
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
{
"system": {
"instanceid": "***REMOVED SENSITIVE VALUE***",
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [
"cloud-staging.m-events.com"
],
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"default_phone_region": "DE",
"memcache.local": "\\OC\\Memcache\\APCu",
"memcache.distributed": "\\OC\\Memcache\\Redis",
"memcache.locking": "\\OC\\Memcache\\Redis",
"filelocking.enabled": "true",
"redis": {
"host": "***REMOVED SENSITIVE VALUE***",
"port": 6379
},
"dbtype": "mysql",
"version": "28.0.3.2",
"overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbport": "",
"dbtableprefix": "oc_",
"mysql.utf8mb4": true,
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"installed": true,
"maintenance": false,
"objectstore": {
"class": "\\OC\\Files\\ObjectStore\\S3",
"arguments": {
"bucket": "m-group-nextcloud-staging",
"key": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"region": "eu-central-1",
"use_ssl": true
}
},
"mail_smtpmode": "smtp",
"mail_sendmailmode": "smtp",
"mail_domain": "***REMOVED SENSITIVE VALUE***",
"mail_smtpauthtype": "LOGIN",
"mail_smtpauth": 1,
"mail_smtphost": "***REMOVED SENSITIVE VALUE***",
"mail_smtpport": "587",
"mail_smtpname": "***REMOVED SENSITIVE VALUE***",
"mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
"ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory",
"twofactor_enforced": "true",
"twofactor_enforced_groups": [],
"twofactor_enforced_excluded_groups": [
"admin"
],
"updater.release.channel": "stable",
"theme": "",
"loglevel": 2,
"app_install_overwrite": [
"twofactor_admin",
"sharelisting",
"officeonline"
],
"mail_from_address": "***REMOVED SENSITIVE VALUE***",
"maintenance_window_start": 1
}
}
List of activated Apps
Enabled:
- activity: 2.20.0
- bruteforcesettings: 2.8.0
- circles: 28.0.0-dev
- cloud_federation_api: 1.11.0
- comments: 1.18.0
- contactsinteraction: 1.9.0
- dav: 1.29.1
- federatedfilesharing: 1.18.0
- federation: 1.18.0
- files: 2.0.0
- files_pdfviewer: 2.9.0
- files_reminders: 1.1.0
- files_sharing: 1.20.0
- files_trashbin: 1.18.0
- files_versions: 1.21.0
- logreader: 2.13.0
- lookup_server_connector: 1.16.0
- notifications: 2.16.0
- oauth2: 1.16.3
- officeonline: 2.1.0
- password_policy: 1.18.0
- privacy: 1.12.0
- provisioning_api: 1.18.0
- quota_warning: 1.18.0
- recommendations: 2.0.0
- related_resources: 1.3.0
- serverinfo: 1.18.0
- settings: 1.10.1
- sharebymail: 1.18.0
- systemtags: 1.18.0
- text: 3.9.1
- theming: 2.3.0
- twofactor_admin: 4.4.0
- twofactor_backupcodes: 1.17.0
- twofactor_totp: 10.0.0-beta.2
- updatenotification: 1.18.0
- user_ldap: 1.19.0
- viewer: 2.2.0
- workflowengine: 2.10.0
Disabled:
- admin_audit: 1.18.0
- dashboard: 7.8.0 (installed 7.3.0)
- encryption: 2.16.0
- files_external: 1.20.0
- files_rightclick: 0.15.1 (installed 1.6.0)
- firstrunwizard: 2.17.0 (installed 2.12.0)
- nextcloud_announcements: 1.17.0 (installed 1.12.0)
- photos: 2.4.0 (installed 1.5.0)
- support: 1.11.0 (installed 1.6.0)
- survey_client: 1.16.0 (installed 1.11.0)
- suspicious_login: 6.0.0
- user_status: 1.8.1 (installed 1.3.1)
- weather_status: 1.8.0 (installed 1.3.0)
Nextcloud Signing status
No errors have been found.
Nextcloud Logs
Call to undefined method OCP\AppFramework\Http\ContentSecurityPolicy::allowInlineScript() in file '/var/www/nextcloud/apps/officeonline/lib/Controller/DocumentController.php' line 384
Additional info
No response
Looks likely fixed by #526
Well when does it get published? I tried every beta from that point on and it is still not included. Isn't it a vital part of Nextcloud to share files with external users?
I'm not sure what beta you're referring to, but you can try out #526 by manually applying to changes to see if it fixes things for you.
Well thank you. I just replaced those two files and it is working again. I was referring to the Nextcloud Server beta, but yes, it is a problem in the OfficeOnline app. Thank you very much! I am still wondering why for this important feature the app didn't get an update. Again, tahnk you for your help. You made my working life so much easier now!