A good fix for Team BLOCK!
Posted: 11. October 2011 09:14
I remember that version 1.0.3 worked in these Block. So I've recheck the SQL of 1.0.3 and put on 2.0.0b1.
I have changed:
To:
And on both SQL versions we have a "Bug". The list doesn't appear with the correct order!
If I have: rui, miguel, Sara, Ana it appears:
Ana
Sara
miguel
rui
Culprit of lowercase and uppercase thing, so I've fix it:
to
(It transforms all to uppercase and then it order! And we don't need the "ASC" info, it's the default value...) the result is now correct:
Ana
miguel
rui
Sara
FINAL CODE:
I have changed:
Code: Select all
u.user_id AS user_id, u.username AS username, u.user_colour AS user_colour, ug.group_id AS group_id
FROM
' . USERS_TABLE . ' AS u,
' . USER_GROUP_TABLE . ' AS ug
WHERE
ug.user_id = u.user_id
AND '. $db->sql_in_set('ug.group_id', $legends) . '
ORDER BY u.username ASC';
Code: Select all
u.user_id, u.username, u.user_colour, u.group_id
FROM
' . USERS_TABLE . ' AS u
WHERE
'. $db->sql_in_set('u.group_id', $legends) . '
ORDER BY u.username ASC';
And on both SQL versions we have a "Bug". The list doesn't appear with the correct order!
If I have: rui, miguel, Sara, Ana it appears:
Ana
Sara
miguel
rui
Culprit of lowercase and uppercase thing, so I've fix it:
Code: Select all
ORDER BY u.username ASC';
Code: Select all
ORDER BY UPPER(u.username) ASC';
Ana
miguel
rui
Sara
FINAL CODE:
Code: Select all
u.user_id, u.username, u.user_colour, u.group_id
FROM
' . USERS_TABLE . ' AS u
WHERE
'. $db->sql_in_set('u.group_id', $legends) . '
ORDER BY UPPER(u.username) ASC';