diff --git a/modules/files/index_table.php b/modules/files/index_table.php index 6cf6d3851..33892a4d0 100644 --- a/modules/files/index_table.php +++ b/modules/files/index_table.php @@ -168,8 +168,8 @@ // Adding an Order by that is different to a group by can cause // performance issues. It is far better to rearrange the group // by to get the correct ordering. -$q2->addGroup('p.project_id'); -$q2->addGroup('f.file_version_id DESC'); +$q2->addOrder('p.project_id'); +$q2->addOrder('f.file_version_id DESC'); $q3 = new DBQuery; diff --git a/modules/tasks/tasks.php b/modules/tasks/tasks.php index 6f996e865..9fc243e91 100644 --- a/modules/tasks/tasks.php +++ b/modules/tasks/tasks.php @@ -229,7 +229,7 @@ // patch 2.12.04 finish date required to be consider finish $where .= (' AND task_project = prj.project_id AND ut3.user_id = ' . $user_id . ' AND ut3.task_id = tsk.task_id ' - . "AND (task_percent_complete < 100 OR task_end_date = '') " + . "AND (task_percent_complete < 100 OR task_end_date IS NULL) " . 'AND prj.project_status <> 7 AND prj.project_status <> 4 ' . 'AND prj.project_status <> 5'); break; @@ -237,7 +237,7 @@ // patch 2.12.04 finish date required to be consider finish // patch 2.12.04 2, also show unassigned tasks $where .= (' AND task_project = prj.project_id ' - . "AND (task_percent_complete < 100 OR task_end_date = '') " + . "AND (task_percent_complete < 100 OR task_end_date IS NULL) " . 'AND prj.project_status <> 7 AND prj.project_status <> 4 ' . 'AND prj.project_status <> 5'); break; diff --git a/modules/tasks/todo.php b/modules/tasks/todo.php index 4e40e5f2a..632245c4c 100644 --- a/modules/tasks/todo.php +++ b/modules/tasks/todo.php @@ -134,7 +134,7 @@ $q->addWhere('task_pinned = 1'); } if (!$showEmptyDate) { - $q->addWhere("ta.task_start_date != '' AND ta.task_start_date != '0000-00-00 00:00:00'"); + $q->addWhere("ta.task_start_date IS NOT NULL AND ta.task_start_date != '0000-00-00 00:00:00'"); }