Skip to content

MultiSites.getAll returns wrong format under circumstances #5987

Closed

Description

@tsteur

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.

Activity

  1. added this to the milestone on Aug 12, 2014
  2. self-assigned this
    on Aug 12, 2014
  3. added 2 commits that reference this issue on Aug 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

BugFor errors / faults / flaws / inconsistencies etc.

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions