piwik/piwik — pull request #6879 by tsteur (2014-12-18 22:03:28+00:00)
Title: When importing visits on a day different from the visit's day, invalidate the archived reports

refs #6850

Workflow is basically as follows:

* Tracker will "remember" an archived report to invalidate if date is not today (in websites timezone)
* Before archiving we will actually invalidate all "remembered" reports
* Once a report was invalidated we will "forget" the previously remembered report to not do it all the time.

For each archived report to remember we store an entry in the `option` table. We make sure to create only one entry per `idSite` and `date`.

I removed the `invalidate_report` call from log importer for now. In case something fails we should fix the actual bug in the core (Tracker or Archiver). In case we notice problems before the 2.10 release we can add the call temporarily again in log importer but only if there is actually an issue and only in case we cannot fix the issue quickly.