diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-08-12 16:01:47 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-08-12 16:01:47 +0400 |
commit | 89297438af917f116434316dcd10b220c8ec8bfb (patch) | |
tree | be15da00045df18b2133a940a3a37bccb3327800 /plugins | |
parent | 45528f5da5f8eeeb0d47bae4d437b8c6010c3afd (diff) |
refs #5987 I think this should make sure we always get an array if MultiSites.getAll finds only one site
Diffstat (limited to 'plugins')
-rwxr-xr-x | plugins/MultiSites/API.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/MultiSites/API.php b/plugins/MultiSites/API.php index f64a673f23..41031fae8f 100755 --- a/plugins/MultiSites/API.php +++ b/plugins/MultiSites/API.php @@ -292,6 +292,13 @@ class API extends \Piwik\Plugin\API ); } + if ($multipleWebsitesRequested && $dataTable->getRowsCount() === 1 && $dataTable instanceof DataTable\Simple) { + $simpleTable = $dataTable; + $dataTable = $simpleTable->getEmptyClone(); + $dataTable->addRow($simpleTable->getFirstRow()); + unset($simpleTable); + } + return $dataTable; } |