diff --git a/api/src/com/todoroo/astrid/data/TaskApiDao.java b/api/src/com/todoroo/astrid/data/TaskApiDao.java index 0885b72a9..ca6363022 100644 --- a/api/src/com/todoroo/astrid/data/TaskApiDao.java +++ b/api/src/com/todoroo/astrid/data/TaskApiDao.java @@ -143,7 +143,11 @@ public class TaskApiDao extends ContentResolverDao { return true; if(values.containsKey(Task.REMINDER_LAST.name) && - values.size() == 1) + values.size() <= 2) + return true; + + if(values.containsKey(Task.REMINDER_SNOOZE.name) && + values.size() <= 2) return true; return false; diff --git a/astrid/src/com/todoroo/astrid/dao/TaskDao.java b/astrid/src/com/todoroo/astrid/dao/TaskDao.java index 07bc1b6d1..3a2cf5142 100644 --- a/astrid/src/com/todoroo/astrid/dao/TaskDao.java +++ b/astrid/src/com/todoroo/astrid/dao/TaskDao.java @@ -159,11 +159,6 @@ public class TaskDao extends DatabaseDao { boolean saveSuccessful; ContentValues values = task.getSetValues(); - if(values == null || values.size() == 0) { - if(task.getDatabaseValues() != null) - return false; - } - if (task.getId() == Task.NO_ID) { saveSuccessful = createNew(task); } else { @@ -180,6 +175,12 @@ public class TaskDao extends DatabaseDao { @Override public boolean createNew(Task item) { + ContentValues values = item.getSetValues(); + if(values == null || values.size() == 0) { + if(item.getDatabaseValues() != null) + return false; + } + if(!item.containsValue(Task.CREATION_DATE)) item.setValue(Task.CREATION_DATE, DateUtilities.now()); item.setValue(Task.MODIFICATION_DATE, DateUtilities.now()); @@ -214,7 +215,14 @@ public class TaskDao extends DatabaseDao { @Override public boolean saveExisting(Task item) { - if(!item.getSetValues().containsKey(Task.DETAILS_DATE.name)) { + ContentValues values = item.getSetValues(); + if(values == null || values.size() == 0) + return false; + + // + if(!item.getSetValues().containsKey(Task.DETAILS_DATE.name) && + !item.getSetValues().containsKey(Task.REMINDER_LAST.name) && + !item.getSetValues().containsKey(Task.REMINDER_SNOOZE.name)) { item.setValue(Task.DETAILS, null); item.setValue(Task.MODIFICATION_DATE, DateUtilities.now()); }