while pager_query generates a multi-page view of the database query result, it doesn't support a constraint that could limit the total number of rows.
the LIMIT clause of SQL is used by this function, so developer can not put a limit on number of rows / pages returned by pager_query.

for example, we have a database table that includes 1000 records (with a timestamp field that shows the last update time) and we would like to create a view that displays only 100 recently updated records in 4 pages (25 records per page)....

I created a patch that adds a new argument ( with default value of 0 ) to the pager_query which allows developers define the maximum number of records (in this example 100) in the query resultset.

CommentFileSizeAuthor
pager.inc_11.patch1.01 KBadli

Comments

merlinofchaos’s picture

Project: Paging » Drupal core
Version: 4.6.x-1.x-dev » 4.6.0
Component: Code » base system

This was filed against the wrong project.

magico’s picture

Version: 4.6.0 » x.y.z
Status: Needs review » Needs work
LAs4n’s picture

Version: x.y.z » 7.x-dev

Is this patch implemented?

Moving to cvs.

casey’s picture

Status: Needs work » Fixed

http://api.drupal.org/api/function/theme_pager/7

D7 has a quantity option: The number of pages in the list.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.