From 9f93407b5e7d2bb0827fb638e68d0d6a8b7ae6ca Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Mon, 7 Jul 2014 15:16:33 -0300 Subject: Fix bug: due date and score lost on update --- app/Model/Task.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app/Model') diff --git a/app/Model/Task.php b/app/Model/Task.php index 469927b7..f08eb910 100644 --- a/app/Model/Task.php +++ b/app/Model/Task.php @@ -368,11 +368,13 @@ class Task extends Base if (! empty($values['date_due']) && ! is_numeric($values['date_due'])) { $values['date_due'] = $this->parseDate($values['date_due']); } - else { + + // Force integer fields at 0 (for Postgresql) + if (isset($values['date_due']) && empty($values['date_due'])) { $values['date_due'] = 0; } - if (empty($values['score'])) { + if (isset($values['score']) && empty($values['score'])) { $values['score'] = 0; } -- cgit v1.2.3