When generating SQL from the topic sort order, we currently use lowercase 'asc' and 'desc', which is against our policy of using uppercase for SQL. Here is some SQL that is generated when building next/prev links, for example:
SELECT n.nid, n.title, n.sticky, l.comment_count, l.last_comment_timestamp FROM node n INNER JOIN node_comment_statistics l ON n.nid = l.nid INNER JOIN term_node r ON n.nid = r.nid AND r.tid = 123 WHERE n.status = 1 AND n.type = 'forum' ORDER BY n.sticky DESC, l.last_comment_timestamp desc
Note that the last keyword is desc, not DESC as it should be.
This one-line patch fixes this when we generate the SQL. We can't just change the assignment in _forum_get_topic_order() because that is used by tablesort.inc and it expects lowercase. So the proper place to do this is in _forum_get_topic_order_sql().
| Comment | File | Size | Author |
|---|---|---|---|
| upperjv.patch | 606 bytes | jvandyk |
Comments
Comment #1
cburschkaApplies, works and makes sense.
Comment #2
gábor hojtsyCommitted to 6.x. Still to be committed to 7.x.
Comment #3
dries commentedCommitted to CVS HEAD. Thanks.
Comment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.