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
When API returns a datatable that has only one column, column name is "value" #7051
Comments
Note: this is due to logic that reduces DataTable w/ one row + one column to single value (ie [{"nb_visits": 0}] turns into 0), so the column name is lost. This logic might be in core/Archive.php as opposed to the DataTable renderer. |
it would be BC break so adding to 3.0.0 milestone in case we want to fix it then |
I was curious and this bug still exists. Return many columns. Return a single column. |
Here is a possible fix for this. #17535 There are currently test failures as I haven't yet updated the expected values in the tests. I'm posting my work thus far in the hopes of verifying that this approach is acceptable. |
I have closed that pull request as this is a breaking change that needs to wait for the next major version (5.0.0). |
We're thinking we need to postpone this to Matomo 6.0.0 due to lack of time. |
Compare eg output of http://demo.piwik.org/index.php?module=API&method=API.get&idSite=7&period=day&date=yesterday&format=JSON&token_auth=anonymous
with output of http://demo.piwik.org/index.php?module=API&method=API.get&idSite=7&period=day&date=yesterday&format=JSON&token_auth=anonymous&columns=nb_visits
Expected is
I wouldn't be surprised if this even causes bugs in the UI etc depending on the selected columns
The text was updated successfully, but these errors were encountered: