joubertredrat / Matomo-ProtectTrackID

A Matomo plugin that protect track ID
https://plugins.matomo.org/ProtectTrackID
MIT License
20 stars 6 forks source link

Piwik break when no hit yet #7

Closed tkapler closed 8 years ago

tkapler commented 8 years ago

If you activate this plugin and there is yet no hit in the database, and try to login with non-global-admin login, the piwik breaks and throws An error occurred You cannot read value of baseSetting setting of "ProtectTrackID" plugin (or slightly different, i got it in my language). It is not critical as it is very unlikely situation

joubertredrat commented 8 years ago

Hi @tkapler Thanks for reports, are you using latest version of plugin? I will investigate this here.

tkapler commented 8 years ago

yes, the latest clean version of piwik (2.6.x) and the latest version clean version of Piwik-ProtectTrackID, tested yesterday. When even a single hit to log db arrives, it works (or if the user is global admin, not just a single site admin or viewer), so it was not a big issue for me, i just wasn't able to find, where the problem is, as imo you are using standard SystemSetting getValue, so maybe it is not a problem of your plugin but in the core.

joubertredrat commented 8 years ago

Hi @tkapler I can reproduce this issue here, I will provide fix for this. Thanks again for your report.

joubertredrat commented 8 years ago

Hi @tkapler I solved this with this commit, https://github.com/joubertredrat/piwik/commit/3351ae04ed906ad541b73eca75fa0fb836f9da3b but Piwik is receiving PR now for new 3.x version, then I can't solve this problem to work with Piwik 2.x, but I will fix this on Piwik 3.x

joubertredrat commented 8 years ago

Hi @tkapler This issue will be solved on new Piwik and plugin major version. If you can test with Piwik 3.0.0-b1, you can clone with branch, https://github.com/joubertredrat/Piwik-ProtectTrackID/tree/dev-1.x