When we have paged results when browsing projects using the new interface, the pager links aren't appearing at the bottom of the page. The relevant lines from project.module:

We use a pager_query, if appropriate.


      $pager = module_invoke($module, 'project_sort_methods', 'pager', $sort_method);
      if ($pager) {
        $first_field = array_shift($sql_elements['fields']['pieces']);
        array_unshift($sql_elements['fields']['pieces'], "COUNT($first_field)");
        $sql_count = project_build_query($sql_elements);
        $result = pager_query($sql, variable_get('default_nodes_main', 10), 0, $sql_count, $parameters);
      }

And at the bottom of the page:


  if ($pager) {
    $output .= theme('pager', NULL, variable_get('default_nodes_main', 10));
  }

But the pager links aren't there.

CommentFileSizeAuthor
#1 project-list-paging.patch1.32 KBnedjo

Comments

nedjo’s picture

Status: Active » Fixed
StatusFileSize
new1.32 KB

This was an issue with the $count_query parameter of the pager_query() call, arising from the use of a GROUP BY clause. Fixed thanks to the good documentation in function pager_query(). We now detect if GROUP BY clause is present, and if so use its field for the counting.

Attached is the patch I applied.

Anonymous’s picture

Status: Fixed » Closed (fixed)