Currently pagers are designed to modify SQL queries directly. They are pretty much useless if you want a pager, but you don't want it messing with your queries.

Example: in one of my contribs I use taxonomy_get_tree() to fetch the data I want to page. Since I have no query to work with, Drupal's pager is useless. I needed to write my own pager functions.

I suggest refactoring the pager functions (we _have_ to get rid of those awful globals with their fuzzy names) so they can be called by providing the total amount of pages and the current page and let modules alter their queries themselves.

Comments

Xano’s picture

Title: Make pager query-independant » Make pager query-independent
Chi’s picture

I think it is possible with pager_default_initialize().