Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

MultiSites.getAll: Add option to not remove sites that have no visits #3786

Closed
tsteur opened this Issue · 11 comments

2 participants

@tsteur
Owner

I'm using MultiSites.getAll for the "All websites dashboard" in new Piwik Mobile app to have same behavior as in Piwik (if MultiSites is enabled by user in settings defaultReport).

If one calls MultiSites.getAll the API will remove websites having 0 visitors. See:
https://github.com/piwik/piwik/blob/master/plugins/MultiSites/API.php#L300

This can result in no displayed websites in the "All Websites Dashboard". -> User can not select a website, can not pick another date or anything else. A user can simply not use the app if no website has a visitor yet.

Is it possible to add an option so that websites having no visitors won't be removed?

@mattab
Owner

In d885213: Fixes #3786 Little hack for Piwik Mobile. You can now pass &enhanced=1 and it will return more metrics + will not remove the websites without visits

@tsteur
Owner

In [changeset:"a5be1e050f1819029d2f5158054356cb216d5fe4/piwikmobile2"]:
set enhanced parameter to prevent removing websites which have no visits, see #3786 . Unfortunately the enhanced parameter seems not to work, will have a deeper look later

@tsteur
Owner

@Matt I reopen this ticket. It seems not to work for me. Maybe because of this? https://github.com/piwik/piwik/blob/master/core/DataAccess/ArchiveWriter.php#L214 Not sure. I have a fresh installation of Piwik here and I get the websites only when switching the period to year because there were only some visitors about a month ago.

Setting the enhanced parameter to 1/true has no effect.

@tsteur
Owner

FYI: Two beta testers have reported problems when the enhanced parameter is enabled (Piwik 1.12):

PHP Fatal error: Call to undefined method Piwik_DataTable_Array::getRows() in /home/***/public_html/***/plugins/MultiSites/API.php on line 256
@tsteur
Owner

create a new website and have a look whether it gets returned by MultiSites.getAll

@tsteur
Owner

In 7e5becd: refs #3786 let the build fail by expecting MultiSites.getAll works with daterange and returns websites having 0 visits

@tsteur
Owner

In f1b47f6: refs #3786 fix websites having 0 visits are not returned, fix MultiSites.getAll does not work with dates like last7

@tsteur
Owner

In a841abc: refs #3786 make sure a website is set in case only one website is requested

@tsteur
Owner

In 8ae0038: refs #3786 MultiSites.getOne should return website even if there are no visits

@tsteur
Owner

In 2a15256: refs #3786 fix MultiSites.getOne week integration test

@tsteur tsteur added this to the 2.0 - Piwik 2.0 milestone
@tsteur tsteur self-assigned this
@sabl0r sabl0r referenced this issue from a commit in sabl0r/piwik
@tsteur tsteur refs #3786 let the build fail by expecting MultiSites.getAll works wi…
…th daterange and returns websites having 0 visits
7e5becd
@sabl0r sabl0r referenced this issue from a commit in sabl0r/piwik
@tsteur tsteur refs #3786 fix websites having 0 visits are not returned, fix MultiSi…
…tes.getAll does not work with dates like last7
f1b47f6
@sabl0r sabl0r referenced this issue from a commit in sabl0r/piwik
@tsteur tsteur refs #3786 MultiSites.getOne should return website even if there are …
…no visits
8ae0038
@sabl0r sabl0r referenced this issue from a commit in sabl0r/piwik
@tsteur tsteur refs #3786 fix MultiSites.getOne week integration test 2a15256
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.