@amashinchi opened this issue on January 30th 2014

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.

@mattab commented on January 30th 2014

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

@amashinchi commented on January 30th 2014

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 commented on January 30th 2014

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

@amashinchi commented on January 30th 2014

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

@mattab commented on January 30th 2014

can you try with latest 2.0.4 beta version?

@halfdan commented on January 31st 2014

Reopening until this is resolved.

@mattab commented on January 31st 2014

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

@amashinchi commented on January 31st 2014

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

@mattab commented on February 4th 2014

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

This issue was closed on January 31st 2014
Powered by GitHub Issue Mirror