diff --git a/libraries/cck/_/table.php b/libraries/cck/_/table.php index a6ef942cd..8ed0f95b7 100644 --- a/libraries/cck/_/table.php +++ b/libraries/cck/_/table.php @@ -104,5 +104,24 @@ public function storeIt() $this->check(); $this->store(); } + + public function store($updateNulls = false) + { + $fields = $this->getFields(); + foreach ($fields as $field => $definition) { + if ( + isset($this->$field) && + $this->$field === '' && + isset($definition->Type) && + stripos($definition->Type, 'date') !== false + ) { + $this->$field = null; + } + } + + return parent::store($updateNulls); + } + } -?> \ No newline at end of file +?> +