Browse Source

Fix task saving with no due date

Timothy J. Warren 1 year ago
parent
commit
5ef2caa70e
1 changed files with 5 additions and 5 deletions
  1. 5
    5
      application/models/task_model.php

+ 5
- 5
application/models/task_model.php View File

@@ -438,7 +438,7 @@ class Task_model extends CI_Model {
438 438
 		//If there is an email reminder
439 439
 		if($this->input->post('reminder') == 'rem_true')
440 440
 		{
441
-			if($due == 0)
441
+			if($due === 0)
442 442
 			{
443 443
 				$err[] = "You must set a due date in order to get a reminder.";
444 444
 			}
@@ -502,9 +502,9 @@ class Task_model extends CI_Model {
502 502
 			$this->friend_perms = (isset($friend_perms)) ? $friend_perms : FALSE;
503 503
 			$this->group_perms = (isset($group_perms)) ? $group_perms : FALSE;
504 504
 			$this->user_id = $this->session->userdata('uid');
505
-			$this->task_id = ($this->input->post('task_id') != FALSE) ?
506
-					$this->input->post('task_id') :
507
-					$this->db->count_all('item') + 1;
505
+			$this->task_id = ($this->input->post('task_id') != FALSE)
506
+				? $this->input->post('task_id')
507
+				: $this->db->count_all('item') + 1;
508 508
 
509 509
 			return TRUE;
510 510
 		}
@@ -626,7 +626,7 @@ class Task_model extends CI_Model {
626 626
 			->set('status', $status)
627 627
 			->set('title', $title)
628 628
 			->set('description', $desc)
629
-			->set('due', $due)
629
+			->set('due', (int)$due)
630 630
 			->set('modified', time())
631 631
 			->where('id', $task_id)
632 632
 			->where('user_id', $uid);