I have a pager missing from one page, while visible on another. These pages are generated by my custom module. I'm working with a custom theme that's been hacked together (wasn't me!) When I switch the theme to Bartik everything works as expected.
Here is the query function:
function query_activities($tid = NULL, $did = NULL) {
$record_count = variable_get('promo_list_count');
$query = db_select('node', 'n')->extend('PagerDefault');
$query->fields('n', array('nid', 'title'));
if ($tid) {
$query->leftJoin('taxonomy_index', 'ti', 'ti.nid = n.nid');
$query->condition('ti.tid', $tid);
}
$query->condition('n.type', 'activity_promo_list');
$query->condition('n.status', 1);
$query->groupBy('n.nid');
$query->orderBy('n.sticky', 'DESC');
$query->orderBy('n.promote', 'DESC');
$query->orderBy('n.changed', 'DESC');
$query->orderBy('n.created', 'DESC');
$query->limit($record_count);
$results = $query->execute()->fetchAll();
return $results;
I have a function that wraps the query results in theme arrays and can post the whole thing if needed (it's 120 lines) but I think the only relevant part is:
$content['pager'] = array(
'#theme' => 'pager',
'#weight' => $count,
'#quantity' => 5,
);
krumo($content['pager']);
return $content;
The krumo() dump shows the pager array populated on both pages (pager visible & pager missing).
Does this narrow the problem to theme layer?
What should I look for to fix or diagnose the missing pager?
THEMENAME_pager
?