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

Call to undefined method OC\Server::getContentSecurityPolicyNonceManager() (Owncloud no longer supported?) #67

Closed
ted-strauss-K1 opened this issue Apr 5, 2019 · 3 comments

Comments

@ted-strauss-K1
Copy link

ted-strauss-K1 commented Apr 5, 2019

Expected behavior

Go to step 2 of plugin installation.

Actual behavior

Owncloud crashes after cloning this plugin into the apps directory.
owncloud.log throws this error:
Error: Call to undefined method OC\Server::getContentSecurityPolicyNonceManager()

I checked the current OC core, and there is no function with that name.
Is there an earlier version of this plugin that might still work with OC?
Is there a workaround to this missing function? Thanks

Steps to reproduce the behavior

  1. Following installation instructions ...
  2. Cloned this repo into folder piwik into owncloud/apps/
  3. Refresh OC web, shows error screen and writes error logs.

Environment

  • App version:

Latest commit f32be86

  • Nextcloud version:

Owncloud version 10.0.10.4

  • Browser vendor and version:

Chrome

  • Any browser plugins enabled?

yes, multiple.

  • Is your Matomo installation working as expected?

yes. works fine with other apps.

Logs

{"reqId":"HThSUq3ZS33e0DQ4Uhcd","level":3,"time":"2019-04-05T21:10:11+00:00","remoteAddr":"xxx.xxx.178.43","user":"admin","app":"PHP","method":"GET","url":"/ocs/v2.php/apps/notifications/api/v1/notifications?format=json","message":"Error: Call to undefined method OC\Server::getContentSecurityPolicyNonceManager() at /var/www/owncloud/apps/piwik/appinfo/app.php#9"}

Javascript

will report back on this one... 

Nextcloud

n/a
@ted-strauss-K1 ted-strauss-K1 changed the title Owncloud no longer supported? Call to undefined method OC\Server::getContentSecurityPolicyNonceManager() (Owncloud no longer supported?) Apr 8, 2019
@sualko
Copy link
Owner

sualko commented Apr 9, 2019

Yes. Owncloud support was silently removed in 0.4, because after the split, I had the feeling that there was no love from Owncloud for app developers. So I stopped supporting Owncloud in all my applications.

If you like you can try to remove the corresponding section in

$policy = new OCP\AppFramework\Http\ContentSecurityPolicy();
if ($url !== false && array_key_exists('HTTP_HOST', $_SERVER)
&& $_SERVER['HTTP_HOST'] !== $url && !empty($url)) {
$policy->addAllowedScriptDomain($url);
$policy->addAllowedImageDomain($url);
\OC::$server->getContentSecurityPolicyManager()->addDefaultPolicy($policy);
}

@sualko sualko closed this as completed Apr 9, 2019
ted-strauss-K1 added a commit to ted-strauss-K1/cloud_piwik that referenced this issue Apr 9, 2019
@ted-strauss-K1
Copy link
Author

http://sualko.github.io/cloud_piwik/
you might want to update this page since it still advertises the app as being intended for OC.

@sualko
Copy link
Owner

sualko commented Apr 10, 2019

Thanks for the hint. I will update the page asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants