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

Do not preserve keys when applying filter_limit/offset #7725

Merged
merged 1 commit into from Apr 21, 2015

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Apr 21, 2015

Just recently I added "preserve array keys" if the first array key is not 0 when using filter_limit/offset but now I noticed it is not a good idea for now. For example if the first array key is 2 we should still not preserve the keys otherwise we would return an object instead of an array in JSON etc.

Output of eg SitesManager.getAllSites before was:

{"2":{"idsite":"2","name":"Botsford Inc","main_url":"http:\/\/www.howell.org","ts_created":"2015-01-25 22:36:51","ecommerce":"0","sitesearch":"1","s...

Output after this fix:

[{"idsite":"2","name":"Botsford Inc","main_url":"http:\/\/www.howell.org","ts_created":"2015-01-25 22:36:51","ecommerce":"0","sitesearch":"1","s...

… we would return an object in json renderer instead of an array
@tsteur tsteur added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Apr 21, 2015
@tsteur tsteur self-assigned this Apr 21, 2015
@tsteur tsteur added this to the Piwik 2.13.0 milestone Apr 21, 2015
tsteur added a commit that referenced this pull request Apr 21, 2015
Do not preserve keys when applying filter_limit/offset
@tsteur tsteur merged commit 3aec8fd into master Apr 21, 2015
@tsteur tsteur deleted the json_filter_fix branch April 21, 2015 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant