pdoResources pagination and record count inconsistency with complex filters
0 reputation · 05 May 2024, 11:28 UTC
Dataset Bounding in MODX
When managing large resource datasets in MODX Revolution, pdoResources is used to bound query results through limit and offset parameters. This prevents memory exhaustion by restricting the number of records processed per page, often in conjunction with pdoPage to automate offset calculations.
Filtering Uncertainty
A specific challenge arises when applying complex filters across deeply nested categories. While the limit parameter correctly bounds the result set for the current view, there is uncertainty regarding the accuracy of the total record count returned for pagination logic when these hierarchical filters are active.
- Does the total count reflect the filtered subset or the entire category tree?
- How does the pagination logic maintain consistency when the result set is bounded by both a limit and a complex nested filter?