Closed (fixed)
Project:
User titles
Version:
5.x-1.0
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Jan 2009 at 16:47 UTC
Updated:
21 Jan 2009 at 02:10 UTC
In user_titles.module the sorting in user_titles_get_titles() is broken. It was OK in rev 1.15.2.1 and got broken in 1.15.2.2.
Line 646 changed from $query = db_query("SELECT title, value, tid FROM {user_titles} ORDER BY value DESC"); to $query = db_query("SELECT * FROM {user_titles} ORDER BY value");
Note the missing sort order specification ("DESC").
Thats why user_titles_get_title() always returns the title with the lowest value.
HTH,
Eric
| Comment | File | Size | Author |
|---|---|---|---|
| user_titles.module.patch | 745 bytes | eric-alexander schaefer |
Comments
Comment #1
eric-alexander schaefer commentedBTW: If the sort order switch was on purpose, then the condition in function
user_titles_get_title()must be changed...Comment #2
agileware commentedHi Eric,
Thanks for picking this up. It was going to be an order switch on purpose but I have changed it back as it will also be safer that way in case other people are calling this function and are expecting it to be descending.
It has been fixed in the 5.x-1.x-dev version, which will be updated sometime in the next half day and a release will be made soon with the change.
Comment #3
agileware commentedThere is now a 5.x-1.1 release with this bug fixed.