On taxonomy term pages pager displays more items than necessary.
E.g. If I set number of posts per page to 10 while total number of posts with the same given taxonomy term is 42, then /taxonomy/term/ will display pager with 9 pages (instead of just 5). Pages 6,7,8,9 will be blank.

I suspect that this might be caused by the fact that $pager_total[$element] returns wrong values on taxonomy pages:

function themename_pager($variables) {
  $element = $variables['element'];
  global $pager_page_array, $pager_total;

  $total_number_of_pages = $pager_total[$element];
  print_r($total_number_of_pages); // This will print strange value on taxonomy pages
}
CommentFileSizeAuthor
#2 634098.patch901 bytesasimmonds

Comments

jarek foksa’s picture

Title: Brkoen pager on /taxonomy/term/* pages » Broken pager on /taxonomy/term/* pages
asimmonds’s picture

Status: Active » Needs review
StatusFileSize
new901 bytes

The count query in taxonomy_select_nodes() was counting all the nodes that had a term, not filtered for the $tid specified.

sivaji_ganesh_jojodae’s picture

The above patch works pretty good for me.

nvanhove’s picture

Status: Needs review » Reviewed & tested by the community

Works for me.

jarek foksa’s picture

Yeah, #2 fixes the problem here too.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Good catch.

Status: Fixed » Closed (fixed)
Issue tags: -taxonomy, -pager, -$pager_total

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

avpaderno’s picture

Issue summary: View changes
Issue tags: -taxonomy, -pager, -$pager_total