
Posted: Thu Apr 21, 2011 19:18 Topic subject: [3.x & 4.x] Error on single post with "Random order
How to reproduce:
1. Blog settings > General > Order by: "Random order"
2. Open any single post page
Exact error message:
Code
| MySQL error! |
| |
| Unknown column 'post_RAND' in 'order clause'(Errno=1054) |
| |
| Your query: Get ID of next item |
| |
| SELECT DISTINCT post_ID |
| FROM stable_items__item |
| INNER JOIN stable_postcats ON post_ID = postcat_post_ID |
| INNER JOIN stable_categories ON postcat_cat_ID = cat_ID |
| WHERE ( cat_blog_ID = 1 ) |
| AND (( post_ptyp_ID IS NULL |
| OR post_ptyp_ID NOT IN (1000,1500,1520,1530,1570,1600,3000) )) |
| AND (post_datestart <= '2011-04-21 10:17') |
| AND ( ( ( post_status = 'private' |
| AND post_creator_user_ID = 1 ) |
| OR post_status IN ('published','protected') ) ) |
| ORDER BY post_RAND ASC, post_ID ASC |
| LIMIT 1 |