Skip to content
This repository has been archived by the owner on Sep 24, 2018. It is now read-only.

Wrong paging when retrieving categories list #2309

Closed
ssmagin opened this issue Feb 24, 2016 · 6 comments
Closed

Wrong paging when retrieving categories list #2309

ssmagin opened this issue Feb 24, 2016 · 6 comments
Labels
Milestone

Comments

@danielbachhuber
Copy link
Member

@ssmagin Which version of the API are you using?

@ssmagin
Copy link
Author

ssmagin commented Feb 24, 2016

I use Version 2.0-beta12

@danielbachhuber
Copy link
Member

@ssmagin and how many categories do you have total? can you more clearly communicate the response you're seeing, and the response you'd expect to see?

@danielbachhuber
Copy link
Member

I've tried reproducing this, and I can't, so I'm keen for more details which can point me in the right direction.

@ssmagin
Copy link
Author

ssmagin commented Feb 24, 2016

I have a test blog with 18 categories.
http://blog.lo/wp-json/wp/v2/categories?page=1&per_page=100 returns me all 18 categories as I expect.
http://blog.lo/wp-json/wp/v2/categories?page=2&per_page=100 also returns me all 18 categories.
But I expect to receive an empty array []. The same problem I have for all pages greater than 1.

Requests with parameter per_page=10 works correctly:
http://blog.lo/wp-json/wp/v2/categories?page=1&per_page=10 returns first 10 categories
http://blog.lo/wp-json/wp/v2/categories?page=2&per_page=10 returns next 8 categories
http://blog.lo/wp-json/wp/v2/categories?page=3&per_page=10 returns an empty array

@danielbachhuber
Copy link
Member

Thanks for the details, @ssmagin. I've been able to identify this as a bug with core: https://core.trac.wordpress.org/ticket/35935

It's easy for us to include a fix for, though, so we'll have it addressed in the next beta. In the interim, you could apply 4a0e3e5 locally if you need an immediate fix.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants