Closed (won't fix)
Project:
Members
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
28 Oct 2007 at 19:13 UTC
Updated:
20 Sep 2010 at 08:48 UTC
Hi I have problem sorting special land char
problem sort the surname, It dose not sort right when I have conutry specific characters as å, ä, ö and so on.......
Have one got any clue?
I have also tryed to write some simple code like this and it dosen't help mee
// Displays a list of all users including their profile images (all roles)
$header = array(
array('data' => t('Avatar'), 'field' => 'u.avatar'),
array('data' => t('User'), 'field' => 'u.name', 'sort' => 'asc'),
array('data' => t('Förnamn'), 'field' => 'u.fornamn'),
array('data' => t('Efternamn'), 'field' => 'u.efternamn')
);
$sql = 'SELECT u.uid, u.name, u.status, u.created, u.access FROM {users} u WHERE uid != 0 AND uid != 6';
$sql .= tablesort_sql($header);
$result = pager_query($sql, 50);
$status = array(t('blocked'), t('active'));
while ($account = db_fetch_object($result)) {
$account = user_load(array('uid' => $account->uid));
if($account->picture){$account->picture = '<img src="'.$account->picture.'" height="125" width="125" border="1" alt="">';}
else{$account->picture = '<img src="files/pictures/default.gif" height="25" width="25" border="1" alt="">';}
$rows[] = array($account->picture, theme('username', $account), $account->profile_fornamn, $account->profile_efternamn);
}
$output = theme('table', $header, $rows);
$output .= theme('pager', NULL, 50, 0);
print ($output);
Comments
Comment #1
wmostrey commentedComment #2
chsiung commentedI can't help you with the above, but I have a similar bug to report.
I've created a "Page" with my members. When I sort by first name, last name, or username, it appears to sort it by the numerical user number (user/192) rather than by name itself. Actually, now that I've tested it further, I don't what it is sorting by.
Interestingly enough, when I sort by email it works as expected.
Was looking in function members_page, but not sure where to go from there.
This is a really useful module by the way!
Chris
Comment #3
dugh commentedYeah I just realized after importing 500 people that sorting by last name doesn't work:
http://itls.usu.edu/people?sort=asc&order=Last+Name
http://itls.usu.edu/people/alumni?sort=asc&order=Last+Name
But with our smaller listings it sorts fine:
http://itls.usu.edu/people/faculty?sort=asc&order=Last+Name
http://itls.usu.edu/people/staff?sort=asc&order=Last+Name
Here's what the sql query looks like: (sorting by "Last Name" for role id 7)
or it sends off to pager_query
Comment #4
dugh commentedLooks it was user_import that corrupted things by adding a bunch of duplicate empty values in the profile_values table.
Sorting was fixed by running queries like
DELETE FROM `profile_values` WHERE value = ''
or for just one profile field: (replace 3 with id # of profile field)
DELETE FROM `profile_values` WHERE fid = 3 AND value = ''
Comment #5
craigdurling commentedIs the profile_values table not supposed to have any empty values? I used the user-Import module and now I have a bunch of empty values. If there is no value for a profile field should it be absent from the table altogether?
Comment #6
wmostrey commented