From 46d711cf510b3795b02bf9a58b64fecb16f4a0b6 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 3 May 2015 11:48:18 -0400 Subject: Fix bug: task references are not unique --- app/Model/TaskFinder.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'app/Model') diff --git a/app/Model/TaskFinder.php b/app/Model/TaskFinder.php index 7216e92a..54dd578a 100644 --- a/app/Model/TaskFinder.php +++ b/app/Model/TaskFinder.php @@ -204,12 +204,13 @@ class TaskFinder extends Base * Fetch a task by the reference (external id) * * @access public + * @param integer $project_id Project id * @param string $reference Task reference * @return array */ - public function getByReference($reference) + public function getByReference($project_id, $reference) { - return $this->db->table(Task::TABLE)->eq('reference', $reference)->findOne(); + return $this->db->table(Task::TABLE)->eq('project_id', $project_id)->eq('reference', $reference)->findOne(); } /** -- cgit v1.2.3