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
}
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 634098.patch | 901 bytes | asimmonds |
Comments
Comment #1
jarek foksa commentedComment #2
asimmonds commentedThe count query in taxonomy_select_nodes() was counting all the nodes that had a term, not filtered for the $tid specified.
Comment #3
sivaji_ganesh_jojodae commentedThe above patch works pretty good for me.
Comment #4
nvanhove commentedWorks for me.
Comment #5
jarek foksa commentedYeah, #2 fixes the problem here too.
Comment #6
dries commentedCommitted to CVS HEAD. Good catch.
Comment #9
avpaderno