sualko / cloud_piwik

Track @Nextcloud users with @matomo-org (formerly Piwik)
http://sualko.github.io/cloud_piwik/
MIT License
37 stars 18 forks source link

Undefined index: HTTP_HOST, no settings shown #23

Closed gjelsas closed 7 years ago

gjelsas commented 7 years ago

I try to set my settings in the administration panel, but I got this error:

"Undefined index: HTTP_HOST at /var/www/nextcloud/apps/piwik/appinfo/app.php#24"

Still it wont show my settings in the administration panel but "occ config:list | grep piwik" shows:

"piwik": "{\"siteId\":\"1\",\"url\":\"\/\/mytopleveldom.ain\/piwik\/\",\"validity\":86400}",

sualko commented 7 years ago

Which version of nextcloud do you use? Any errors in your javascript console?

gjelsas commented 7 years ago

I'm on Nextcloud 11.0.0 (stable)

my Vivaldi Browser says:

Uncaught TypeError: Cannot read property 'getItem' of undefined at track.js?v=ec9c03f…:8 at track.js?v=ec9c03f…:81 (anonymous) @ track.js?v=ec9c03f…:8 (anonymous) @ track.js?v=ec9c03f…:81

and:

Uncaught SyntaxError: Unexpected token o in JSON at position 1 at JSON.parse () at Object.success (settings-admin.js?v=ec9c03f…:5) at j (jquery.js:3099) at Object.fireWith [as resolveWith] (jquery.js:3211) at x (jquery.js:8264) at XMLHttpRequest. (jquery.js:8605)

But I'm no expert at all on javascript...

sualko commented 7 years ago

Can you try to remove the OC. from https://github.com/sualko/owncloud_piwik/blob/master/js/track.js#L8 and https://github.com/sualko/owncloud_piwik/blob/master/js/track.js#L23?

gjelsas commented 7 years ago

Wow, that worked for me!