[development] pager_query() vs. theme('pager') argument handling

Earl Miles merlin at logrus.com
Fri Apr 21 22:21:51 UTC 2006


Derek Wright wrote:
> i was testing a bugfix to the project module (removing
> tablesort_pager() from the call to theme('pager')) and noticed that
> the $limit and $element args for theme('pager') vs. the ones to
> pager_query() are duplicated.  in IRC, steven (unconed) pointed me to:
> 
>  http://drupal.org/node/5371#comment-89191
> 
> if theme('pager') is smart enough to remember the query (which is why
> y'all got rid of tablesort_pager() in the first place), why does
> theme('pager') need to take these other args, either, since they're
> also passed to pager_query()?  we definitely want these to match, or
> else the prev/next and numbered links generated by theme('pager')
> won't match the data being displayed.
'all these other' args?

There are 4 args.

1) Tags. This is something that should probably be handled more by theming, but 
still. Has nothing to do with the query. Not passed to pager_query().
2) Limit. Yes, I grant that pager_query() should probably (and possibly does) 
remember this number.
3) Element ID. THis is critical. You can't not have this one. Passed to 
pager_query() but since you can have more than one pager per page, you have to 
have this to identify which pager you're using.
4) parameters. Part of the links; not important to pager_query().

So yea, you could eliminate argument 2 there. Perhaps that's worthwhile in 4.8. 
I'm not so sure.




More information about the development mailing list