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

MultiSites.getAll returns wrong format under circumstances #5987

Closed
tsteur opened this issue Aug 12, 2014 · 0 comments
Closed

MultiSites.getAll returns wrong format under circumstances #5987

tsteur opened this issue Aug 12, 2014 · 0 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@tsteur
Copy link
Member

tsteur commented Aug 12, 2014

MultiSites.getAll should always return an array of objects but sometimes it returns only a simple array (if there is only one site that matches pattern I think).

Example Url:
http://demo2.piwik.org/index.php?module=API&method=MultiSites.getAll&period=year&date=today&format=JSON&token_auth=TOKEN&pattern=piw&enhanced=1

{
nb_visits: 0,
nb_actions: 0,
label: "Example Site",
visits_evolution: "0%",
actions_evolution: "0%",
...
}

should be wrapped in [...].

I tried to workaround this issue in Piwik Mobile but it does also not return the idSite if there is only one result which makes it impossible.

This leads to an "Invalid format error" in Piwik Mobile when using the search.

@tsteur tsteur added this to the Piwik 2.5.0 milestone Aug 12, 2014
@tsteur tsteur added the Bug label Aug 12, 2014
@tsteur tsteur self-assigned this Aug 12, 2014
tsteur added a commit that referenced this issue Aug 12, 2014
@tsteur tsteur closed this as completed Aug 12, 2014
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

No branches or pull requests

1 participant