Closed (fixed)
Project:
Advanced User
Version:
5.x-2.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Jul 2006 at 10:19 UTC
Updated:
17 Jun 2008 at 20:42 UTC
Jump to comment: Most recent
Comments
Comment #1
Mojah commentedI've been looking at the code of the user module and the node module for quite some time trying to figure out how to get a sortable pager working, but have not yet figured it out. Just to let you know, that it is being worked on.
Comment #2
syngi commented> The pager isn't yet working because the count query for the pager_query isn't working. You can check this by printing the global variable $pager_total after running the query:
after
$result = ppager_query('SELECT u.* FROM {users} u '. $filter['join'] .' LEFT JOIN {profile_values} pv ON u.uid = pv.uid LEFT JOIN {profile_fields} pf on pv.fid = pf.fid '. $filter['where'] .' GROUP BY u.uid '. $filter['having'] .' ORDER BY u.login DESC', $listno, 99, NULL, $filter['args']);the lines
> I found out that this is due to the group by clause.
For example, this is a query that runs when I search on a location field I added with profiles.module
the count query for it, inside pager_query, will be
Changing the query to
seems to work for this case (returns the right count), but I don't know if the same logic will work in all other cases...
Comment #3
syngi commentedShould changing the query this way not suffice, then perhaps the query (and PHP code for it) I posted at http://drupal.org/node/107973 will do. This will allow you to also fetch values from fields added with profile.module.
Comment #4
Anonymous (not verified) commentedIs this still broken in 5.x-2.x-dev?
Comment #5
Anonymous (not verified) commentedWorks for me.
Comment #6
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.