MySQL error 1250: Table 'contacts' from one of the SELECTs cannot be used in global ORDER clause

Edit file /data/SugarBean.php

the code to edit is near line 930

            //Put the query into the final_query
            $query = $subquery['select'] . " " . $subquery['from'] . " " . $subquery['where'];
            if (!$first) {
                $query = ' UNION ALL ( ' . $query . ' )';
                $final_query_rows .= " UNION ALL ";
            } else {
                **//$query = '(' . $query . ')';**  COMENT HERE
                $first = false;
            }
2 Likes