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

Comments

Projects
None yet
2 participants
@tsteur
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment