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
Piwik_Query() throws exception when used in a Tracker event hook #882
Comments
That's the intended behaviour. To keep it lightweight, the tracker (and tracker hooks) don't use Zend_Db. Your "workaround" is the correct approach for a tracker hook. |
I created #884 to list all missing documentation about functions to use. |
Can you please explain what the workaround is or provide a link that does? Thanks |
Ha, nevermind. I don't know why I didn't see that before. Piwik_Tracker::getDatabase()->query($query, $params); |
reopening and setting as documentation update |
If I'm not mistaken, I think [1970]+[2012] now allows Piwik_Query() to be called from a Tracker event hook. |
Replying to vipsoft: Whether or not it works depends on whether or not getCacheWebsiteAttributes() has already been called. For example, it wouldn't work for a listener on the 'Tracker.Visit.isExcluded' hook. |
right, I think the idea would be to make the function call work in all cases, or document that Tracker functions must use Piwik_Tracker::getDatabase()->query($query, $params); |
I get the following exception when trying to use Piwik_Query() from within my plugin:
Here is my hook registration:
And my handler implementation:
--- WORKAROUND ---
A workaround is available, but this deviates from the published "Security Checklist" which recommends the use of Piwik_Query().
The text was updated successfully, but these errors were encountered: