Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Closed
anonymous-piwik-user opened this Issue · 10 comments

3 participants

@anonymous-piwik-user

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
Owner

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
Owner

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
Owner

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

@tsteur
Owner

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
Owner

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
Owner

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
Owner

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
Owner

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

@mattab
Owner

In f45a669: Refs #4532 Adding forgotten test files

@anonymous-piwik-user

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

@anonymous-piwik-user anonymous-piwik-user added this to the 2.1 - Piwik 2.1 milestone
@sabl0r sabl0r referenced this issue from a commit in sabl0r/piwik
@tsteur tsteur refs #4532 this should fix custom data range values are not always wo…
…rking. In this case periods like week, month or year were ignored in case the data range was large enough to use one of those
40eabd8
@sabl0r sabl0r referenced this issue from a commit in sabl0r/piwik
@tsteur tsteur Refs #4532 Adding forgotten test files f45a669
@sabl0r sabl0r referenced this issue from a commit in sabl0r/piwik
vagrant refs #4532 easier fix with less logic 0cd0888
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.