$pager_total is declared once and never used. This removes it.

CommentFileSizeAuthor
solr_pager_total.patch711 bytesScott Reynolds

Comments

pwolanin’s picture

there is a nasty hack to use page_query, so maybe that lines is left over.

We should really build (and push to D7 core) a non-query-based pager builder like:

function pager_build($count_total, $limit = 10, $element = 0) {
  global $pager_page_array, $pager_total, $pager_total_items;
  $page = isset($_GET['page']) ? $_GET['page'] : '';

  // Convert comma-separated $page to an array, used by other functions.
  $pager_page_array = explode(',', $page);

  // We calculate the total of pages as ceil(items / limit).
  $pager_total_items[$element] = $count_total;
  $pager_total[$element] = ceil($pager_total_items[$element] / $limit);
  $pager_page_array[$element] = max(0, min((int)$pager_page_array[$element], ((int)$pager_total[$element]) - 1));
  return array('offset' => $pager_page_array[$element] * $limit, 'limit' => $limit);
}
pwolanin’s picture

Version: 6.x-1.0-alpha5 » 6.x-1.x-dev
Status: Needs review » Needs work
robertdouglass’s picture

Status: Needs work » Closed (won't fix)

Has been fixed elsewhere.

jpmckinney’s picture

Status: Closed (won't fix) » Fixed

Correct status.

Status: Fixed » Closed (fixed)

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