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

Custom date range not working if archiving triggered by report view from browser is disabled #4532

Closed
anonymous-matomo-user opened this issue Jan 15, 2014 · 10 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Milestone

Comments

@anonymous-matomo-user
Copy link

If in Settings --> General settings the option BrowserTriggerArchiving is disabled, you can't use the feature of custom date range. The data shown in reports like "Referrers" is incorrect.

There are use-cases for having the archiving triggered by browser disabled for the "big" archiving tasks e.g. daily, weekly, monthly, etc. on the one hand and still the need for custom date range usage on the other hand.

Data processing for the standard timerange reports is done by cron job. Of course you can't trigger the processing of data for custom date ranges by cron job.

If the processing triggered by browser in "General settings" is disabled an extra option to enable it for custom date range usage should appear.

At least this behavior should be documented in http://piwik.org/docs/setup-auto-archiving/ and noticed in the Piwik Backend in "General settings". And because for now custom date range is not working if BrowserTriggerArchiving is disabled it can be disabled as well.

Identical bug like #4069

Maybe change the function isRequestAuthorizedToArchive in core/ArchiveProcessor/Rules.php

    protected static function isRequestAuthorizedToArchive()
    {
        return !self::$archivingDisabledByTests &&
        (Rules::isBrowserTriggerEnabled()
            || Common::isPhpCliMode()
            || (Piwik::isUserIsSuperUser()
                && SettingsServer::isArchivePhpTriggered()));
    }
@mattab
Copy link
Member

mattab commented Jan 21, 2014

Thanks for the report.

When you say "incorrect reports" can you explain? Does the data displayed is incomplete and display "wrong" values ? does it display zeros ?

@mattab
Copy link
Member

mattab commented Jan 22, 2014

It was also reported in : http://forum.piwik.org/read.php?8,110249

Custom date range:

01-01-2014 au 05-01-2014 = 445 unique downloads
01-01-2014 au 12-01-2014 = 445
01-01-2014 au 19-01-2014 = 445
09-01-2014 au 19-01-2014 = 516

BUT we have for weeks:

06-01-2014 au 12-01-2014 = 1166
13-01-2014 au 19-01-2014 = 1311

@mattab
Copy link
Member

mattab commented Jan 22, 2014

Possibly also this bug in http://forum.piwik.org/read.php?2,110257

@tsteur
Copy link
Member

tsteur commented Jan 24, 2014

So what is a proper fix here? Adding another setting to allow triggering archiving from browser if period=range?

I tried to reproduce it and although trigger archiving from browser is disabled it did trigger the archiving but not 100% sure whether archived values are correct.

@mattab
Copy link
Member

mattab commented Jan 27, 2014

Bug is that it seems in some cases, custom date ranges will not return valid data, when browser archiving is disabled.

The correct fix, is to make Custom Date ranges always work (returning correct data) when browser trigger archiving is enabled. This is supposed to work and definitely, used to work. Must be a regression from my refactoring of Archiver in 2.0

@tsteur
Copy link
Member

tsteur commented Jan 29, 2014

The correct fix, is to make Custom Date ranges always work (returning correct data) when browser trigger archiving is enabled.

Hey, still not clear how it should behave when archiving is disabled. Not archive at all and not display "Range" in date picker? Add another option to enable browser archiving just for range dates? Ignore the setting and archive though?

@tsteur
Copy link
Member

tsteur commented Jan 29, 2014

In 40eabd8: refs #4532 this should fix custom data range values are not always working. In this case periods like week, month or year were ignored in case the data range was large enough to use one of those

@mattab
Copy link
Member

mattab commented Jan 30, 2014

In bd09242: Refs #4532 Adding integration test case for this use case

@mattab
Copy link
Member

mattab commented Jan 30, 2014

In f45a669: Refs #4532 Adding forgotten test files

@anonymous-matomo-user
Copy link
Author

In 0cd0888: refs #4532 easier fix with less logic

@anonymous-matomo-user anonymous-matomo-user added this to the 2.1 - Piwik 2.1 milestone Jul 8, 2014
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
… always working. In this case periods like week, month or year were ignored in case the data range was large enough to use one of those
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Projects
None yet
Development

No branches or pull requests

3 participants