From 5ef2caa70e743045a1f08e565b57cb693ed5338c Mon Sep 17 00:00:00 2001 From: Timothy J Warren Date: Thu, 29 Dec 2016 14:05:45 -0500 Subject: [PATCH] Fix task saving with no due date --- application/models/task_model.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) mode change 100755 => 100644 application/models/task_model.php diff --git a/application/models/task_model.php b/application/models/task_model.php old mode 100755 new mode 100644 index 97d2c71..8385368 --- a/application/models/task_model.php +++ b/application/models/task_model.php @@ -438,7 +438,7 @@ class Task_model extends CI_Model { //If there is an email reminder if($this->input->post('reminder') == 'rem_true') { - if($due == 0) + if($due === 0) { $err[] = "You must set a due date in order to get a reminder."; } @@ -502,9 +502,9 @@ class Task_model extends CI_Model { $this->friend_perms = (isset($friend_perms)) ? $friend_perms : FALSE; $this->group_perms = (isset($group_perms)) ? $group_perms : FALSE; $this->user_id = $this->session->userdata('uid'); - $this->task_id = ($this->input->post('task_id') != FALSE) ? - $this->input->post('task_id') : - $this->db->count_all('item') + 1; + $this->task_id = ($this->input->post('task_id') != FALSE) + ? $this->input->post('task_id') + : $this->db->count_all('item') + 1; return TRUE; } @@ -626,7 +626,7 @@ class Task_model extends CI_Model { ->set('status', $status) ->set('title', $title) ->set('description', $desc) - ->set('due', $due) + ->set('due', (int)$due) ->set('modified', time()) ->where('id', $task_id) ->where('user_id', $uid);