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

Ensure Database is set in Tracker #215

Closed

Conversation

amashinchi
Copy link

Perform an added check to ensure the database is connected prior to returning it.
Corrects an error encountered in bulk tracking with PIWIK_TRACKER_MODE set.

…eturning it. Corrects an error encountered in bulk tracking with PIWIK_TRACKER_MODE set.
@mattab
Copy link
Member

mattab commented Jan 30, 2014

What error? how do you use bulk tracking and manage to trigger such error?

@mattab mattab closed this Jan 30, 2014
@amashinchi
Copy link
Author

I am using 2.0.3 and an token_auth for bulk tracking, as well as have $GLOBALS['PIWIK_TRACKER_MODE'] set to true.

On every valid bulk request submission I had the following error,

PHP Fatal error: Call to a member function fetchAll() on a non-object in ... /piwik/core/Db.php on line 164

I found that fetchAll() retrieved it's db object from get(), which was calling Tracker::getDatabase(), which was returning null.

Upon adding my check, everything worked.

@mattab
Copy link
Member

mattab commented Jan 30, 2014

Don't set $GLOBALS['PIWIK_TRACKER_MODE'] to true and it should work

@amashinchi
Copy link
Author

If it's not set, then my token_auth fails validation.

@mattab
Copy link
Member

mattab commented Jan 30, 2014

can you try with latest 2.0.4 beta version?

@halfdan halfdan reopened this Jan 31, 2014
@halfdan
Copy link
Member

halfdan commented Jan 31, 2014

Reopening until this is resolved.

@mattab
Copy link
Member

mattab commented Jan 31, 2014

if there's a bug please, let's open a bug report first...

@mattab mattab closed this Jan 31, 2014
@amashinchi
Copy link
Author

Added bug report: https://dev.piwik.org/trac/ticket/4603

@mattab
Copy link
Member

mattab commented Feb 4, 2014

Thanks, it's been fixed (and integration test added, so it does not break again in the future!)

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

Successfully merging this pull request may close these issues.

None yet

3 participants