id summary reporter owner description type status priority milestone component version severity resolution keywords cc focuses 20711 Some posts queries with menu_order are ambiguous markjaquith ryan "Starting in 3.4, I started getting errors like this: {{{ WordPress database error Column 'menu_order' in order clause is ambiguous for query SELECT txfx_wp_posts.ID FROM txfx_wp_posts LEFT JOIN txfx_wp_posts AS p2 ON (txfx_wp_posts.post_parent = p2.ID) WHERE 1=1 AND txfx_wp_posts.ID IN (12163,12164,12165,12166,12167,12168,12169,12170,12171,12172) AND (txfx_wp_posts.post_mime_type LIKE 'image/%') AND txfx_wp_posts.post_type = 'attachment' AND ((txfx_wp_posts.post_status = 'inherit') OR (txfx_wp_posts.post_status = 'inherit' AND (p2.post_status = 'inherit'))) ORDER BY menu_order,txfx_wp_posts.ID ASC LIMIT 0, 10 }}} It relates to the ""[gallery]"" shortcode. The code issue predates 3.4, but I think that the query itself changed to be a self-join, which introduces the ambiguity. This is solved by prefixing menu_order with the table name, like we do for the other ones. See patch." defect (bug) closed high 3.4 General major fixed has-patch commit