Posted by douggreen on September 4, 2007 at 7:20pm
| Project: | Drupal core |
| Version: | 7.x-dev |
| Component: | base system |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Issue Summary
I was working on the z3950 module, which implements hook_search to display content from z39.50 (library) servers. The results being displayed aren't from a Drupal database, so pager_query() can't be used. But, there are lots of results, that can be chunked into pages, and thus should use the Drupal paging system.
The attached patch slightly refactors pager_query, keeping the original functionality intact, but exposes a new function called pager_init() which can be used by contrib modules.
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| pager_5.patch | 2.03 KB | Ignored: Check issue status. | None | None |
Comments
#1
... removing one extraneous line in patch file
#2
i once did this without a patch: http://cvs.drupal.org/viewvc.py/drupal/contributions/tricks/pager_withou.... that might have bit rotted since then. maybe this patch is useful still - i dunno.
#3
Yes, it can be done without a patch. I'm just proposing some refactoring so that we get a new API function that makes it easier to do. Compared to your "trick" solution, what you get by using the pager call is an additional calculations on page position.
#4
Reroll from root.
D7 fodder?
Reroll brought to you by patch bingo.
#5
If it can be done without API changes, I guess it will be something for D7...
#6
Patch still applied.
#7
Why is testbot not testing this?
I like it muchly - reinventing pagers just because you are not using a database query is annoying.
#8
* Coding standard correction in comments.
* Add NULL default argument for $count in
pager_init()#9
Needs updating for dbtng - db_result() is deprecated.