PDA

View Full Version : CVS Snapshot - bugs


zenon
24-03-05, 12:30 AM
Hello, I discovered some errors:

1) In modules->projects->gantt.php (near 224 row):

"SELECT" created by DBQuery object :

$q = new DBQuery;
$q->addTable('tasks');
$q->addQuery('DISTINCT tasks.task_id, tasks.task_name, tasks.task_start_date, tasks.task_end_date, tasks.task_milestone');
$q->addJoin('companies', 'c1', 'p.project_company = c1.company_id');
$q->addJoin('projects', 'p', 'p.project_id = tasks.task_project');
$q->addWhere("p.project_id = {$p["project_id"]}");
$q->addOrder('tasks.task_end_date ASC');
$tasks = $q->loadList();

doesn't work good and returns error:

Cross dependency found in OUTER JOIN. Examine your ON conditions

Solution is writing it static without using DBQuery class:

$sql = "SELECT DISTINCT tasks.task_id, tasks.task_name, tasks.task_start_date, tasks.task_end_date, tasks.task_milestone
FROM tasks, companies c1 , projects p
WHERE p.project_company = c1.company_id AND p.project_id = tasks.task_project AND p.project_id = " .$p["project_id"] . "
ORDER BY tasks.task_end_date ASC";
$tasks = db_loadList( $sql );


-------------------------------------------------------------------------------

2) In modules->projects->gantt2.php (end of file, near 258row):

$graph->Add($vline);

should be:

$graph2->Add($vline);


-------------------------------------------------------------------------------

...and small question: Why "gantt2.php" is not added in modules->projects->viewgantt.php? I think it is good feature to use...

pedroa
24-03-05, 01:35 AM
See here what gantt2.php is about http://www.dotproject.net/index.php?name=PNphpBB2&file=viewtopic&t=1934&highlight=gantt2

ajdonnison
24-03-05, 07:38 AM
I believe the addJoin in the above query should be leftJoin. I will check this out though.