From 6c130cd3ca056f7ca3232b56c6844d0c93cf3654 Mon Sep 17 00:00:00 2001 From: Simon Holywell Date: Wed, 2 May 2012 12:18:53 +0100 Subject: [PATCH] Fix error where a due date of 0000-00-00 00:00:00 was not equated to empty by forcing to null in model restore() method --- src/IDF/Issue.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/IDF/Issue.php b/src/IDF/Issue.php index edbd73f..0d115e6 100644 --- a/src/IDF/Issue.php +++ b/src/IDF/Issue.php @@ -156,6 +156,15 @@ class IDF_Issue extends Pluf_Model IDF_Search::remove($this); } + function restore() + { + // Note: If a due date has not been set then it should + // be set to null and not a useless/confusing date so... + if ('0000-00-00 00:00:00' === $this->due_dtime) { + $this->due_dtime = null; + } + } + function preSave($create=false) { if ($this->id == '') {