Problem/Motivation
Currently, pagination is done counting the rows in the result set retrieved from the JSON file. Several services provides JSON endpoint for their data with support for pagination in the query string of the JSON URI. These service usually provide a total items count as part of their response.
Proposed resolution
Add the following query options:
- Rows count apart
- Enable support of the pagination query parameter
- Limit query string parameter name
- Offet query string parameter name
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | better_pagination_support-2250031-7.patch | 5.59 KB | discipolo |
| #3 | better_pagination_support-2250031-3.patch | 5.9 KB | pbuyle |
Comments
Comment #1
pbuyle commentedThe attached patch implement the suggested solution.
The row count extraction is done in
views_json_query_plugin_query_json::parse(). Injection of the pagination query string parameters is done inviews_json_query_plugin_query_json::build().Comment #2
pbuyle commentedComment #3
pbuyle commentedRework of the patch to remove an extra '/' that was added between the host and the path componenet of the JSON file URL.
Comment #4
marcofernandes commentedI'll try today to apply this and others patches on other issues to dev branch.
Thanks Pierre for the great work :).
Comment #5
3eidoz commentedwhen i try to apply patch, tell me The patch cannot be applied in the selected context.
can help plz
Comment #6
pbuyle commentedAs reported by @tariqinam this does not cover everything that
parse_url()could produce. Thehttp_build_urlfunction could be used but it requires a PECL extensions. There is a non-PECL implementation available at https://github.com/jakeasmith/http_build_url that could be embedded in the module.Comment #7
discipolo commentedrerolling anyway
Comment #9
marcofernandes commentedAlso merged #2250191 latest patch. Setting this to fixed.