Project_task table unknown error

Hi-

We get the error below in the suitecrm.log file when attempting to look at Tasks in a Project:

Fri May 26 17:17:18 2023 [883268][1][FATAL] Mysqli_query failed.
Fri May 26 17:17:18 2023 [883268][1][FATAL] Error retrieving Project list: Query Failed: (SELECT project_task.id , project_task.name , project_task.date_start , project_task.date_finish ,
project_task.assigned_user_id, ‘projecttask’ panel_name FROM project_task INNER JOIN project projecttask_rel ON project_task.project_id=projecttask_rel.id AND projecttask_rel.deleted=0 where ( project_task.project_id=‘75d8d439-b9af-d28f-3af4-64710a8aa401’) AND project_task.deleted=0) ORDER BY project_task.project_task_id asc LIMIT 0,10: MySQL error 1109: Unknown table ‘project_task’ in order clause
Fri May 26 17:17:18 2023 [883268][1][FATAL] [ListView::processUnionBeans] . Database failure. Please refer to suitecrm.log for details.

There appears to be something wrong with the “INNER JOIN” part of this query. If we extract it, that is, change the query to:

SELECT project_task.id , project_task.name , project_task.date_start , project_task.date_finish ,
project_task.assigned_user_id, ‘projecttask’ panel_name FROM project_task ORDER BY project_task.project_task_id asc LIMIT 0,10;

and run the query in Mysql, it retturns the expected data.

Any help in correcting this would be greatly appreciated.

FYI, we are running a fresh instance of SuiteCRM 8.3.0 on:

Ubuntu 22.04 with
PHP v. 8.0.28,
MySQL: 8.0.33-0ubuntu0.22.04.2,
Apache/2.4.57 (Ubuntu)

Thanks!

I suggest opening an issue for this in Github, if it isn’t already there.

Hi,
To fix:
In SuiteCRM public/legacy/data/SugarBean.php
Comment out line 885 & 939

Line 885: // $final_query = ‘(’ . $tmp_final_query . ‘)’;
…
Line 939: // $query = ‘(’ . $query . ‘)’;

That’s not entirely correct. The correct fix can be found on Github.