Skip to content

Ensure Database is set in Tracker #4603

@anonymous-matomo-user

Description

@anonymous-matomo-user

When using 2.0.3 and an token_auth for bulk tracking, as well as have 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.

I've submitted a fix/pull request here:

#215

Upon adding my check, everything worked.

Please note that if I set PIWIK_TRACKER_MODE to false, then Piwik stops accepting my token_auth key.

I want my fix to be applied upstream, and it was suggested that a bug report needed to be submitted first.
Keywords: buk tracking

Metadata

Metadata

Assignees

Labels

BugFor errors / faults / flaws / inconsistencies etc.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions