#64042 closed defect (bug) (invalid)
Media / REST API: duplicate records in paginated results when filtering by media_type
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | |
| Component: | REST API | Keywords: | |
| Focuses: | rest-api | Cc: |
Description
In the attachments REST API endpoint, the endpoint returns the same attachment record over subsequent pages when filtering by media_type.
For example, given 25 attachment posts, the first request will return 20 records:
/wp-json/wp/v2/media?context=view&per_page=20&page=1&media_type=image
like so:
[ ...records, { id: 18, ...fields } ]
the request for the second page,
/wp-json/wp/v2/media?context=view&per_page=20&page=2&media_type=image
returns the remaining five
[ ...records, { id: 18, ...fields }, ...records ]
It appears to be true regardless of the per_page value or how many records exist.
Change History (4)
Note: See
TracTickets for help on using
tickets.
Actually, I can't reproduce any more on WordPress trunk :-)
I'll test again and close this ticket if I've taken a wrong turn somewhere.