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

showColumns in Multisites API by pageviews does not work #11471

Closed
tsteur opened this issue Mar 9, 2017 · 0 comments · Fixed by #11472
Closed

showColumns in Multisites API by pageviews does not work #11471

tsteur opened this issue Mar 9, 2017 · 0 comments · Fixed by #11472
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@tsteur
Copy link
Member

tsteur commented Mar 9, 2017

eg see it has pageviews https://demo.piwik.org/index.php?module=API&method=MultiSites.getAll&period=day&date=yesterday&format=JSON&token_auth=anonymous

doesn't work
https://demo.piwik.org/index.php?module=API&method=MultiSites.getAll&period=day&date=yesterday&format=JSON&token_auth=anonymous&showColumns=nb_pageviews

does work for visits
https://demo.piwik.org/index.php?module=API&method=MultiSites.getAll&period=day&date=yesterday&format=JSON&token_auth=anonymous&showColumns=nb_visits

It works when adding &enhanced=1 because of

if ($multipleWebsitesRequested
            // We don't delete the 0 visits row, if "Enhanced" mode is on.
            && !$enhanced
        ) {
            $dataTable->filter(
                'ColumnCallbackDeleteRow',
                array( self::NB_VISITS_METRIC, function ($value) { return $value == 0;  }  )
            );
        }

This should be only executed when the visits column was actually requested

@tsteur tsteur added the Bug For errors / faults / flaws / inconsistencies etc. label Mar 9, 2017
@mattab mattab added this to the 3.0.3 milestone Mar 21, 2017
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants