diff --git a/etemplate/inc/class.etemplate_widget_date.inc.php b/etemplate/inc/class.etemplate_widget_date.inc.php index d7ada97738..4fbfe57ef7 100644 --- a/etemplate/inc/class.etemplate_widget_date.inc.php +++ b/etemplate/inc/class.etemplate_widget_date.inc.php @@ -70,6 +70,10 @@ class etemplate_widget_date extends etemplate_widget_transformer { self::set_validation_error($form_name,lang('Field must not be empty !!!')); } + elseif (is_null($value)) + { + $valid = null; + } elseif ($this->type == 'date-duration') { $valid = (string)$value === '' ? '' : (int)$value; @@ -83,11 +87,6 @@ class etemplate_widget_date extends etemplate_widget_transformer { // Nothing to do here } - // Null is acceptable also - elseif ($value === null) - { - $valid = $value; - } else { // this is not really a user error, but one of the clientside engine