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:
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?
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
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
@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.
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
enhanced=1 seems to work here: http://demo.piwik.org/index.php?module=API&method=MultiSites.getAll&period=month&date=2013-09-01&format=xml%20&enhanced=1
Do you have URL showing the bug?
create a new website and have a look whether it gets returned by MultiSites.getAll
In 7e5becd: refs #3786 let the build fail by expecting MultiSites.getAll works with daterange and returns websites having 0 visits
In f1b47f6: refs #3786 fix websites having 0 visits are not returned, fix MultiSites.getAll does not work with dates like last7
In a841abc: refs #3786 make sure a website is set in case only one website is requested
In 8ae0038: refs #3786 MultiSites.getOne should return website even if there are no visits
In 2a15256: refs #3786 fix MultiSites.getOne week integration test
refs #3786 let the build fail by expecting MultiSites.getAll works wi…
…th daterange and returns websites having 0 visits
refs #3786 fix websites having 0 visits are not returned, fix MultiSi…
…tes.getAll does not work with dates like last7
refs #3786 make sure a website is set in case only one website is req…
refs #3786 MultiSites.getOne should return website even if there are …
refs #3786 fix MultiSites.getOne week integration test