Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
1.0.2
-
None
Description
Steps to reproduce
- Attach a pagination to your jsonDatasource
- Set a breakpoint inside a while loop here
info.magnolia.rest.ui.PaginatedJsonDataProvider#fetchFromBackEnd - Start scroll a little bit down to switch page
Expected results
Dataprovider fetching only required amount of pages.
Actual results
Dataprovider fetches ALL pages from a datasource
Workaround
Override JsonDataProvider and add this checking
if (definition.getPagination() != null) { return jsonNodes; }
in a filterResponse method
Development notes
Here
info.magnolia.rest.ui.JsonDataProvider#filterResponse
we have json nodes partitioning, which, I think, shouldn't be performed when pagination is enabled, because in this checking
if (start >= length) { return Collections.emptyList(); }
we returning empty list and while loop which mentioned above just can't break until it fetches all pages
Checklists
Acceptance criteria