diff --git a/e107_handlers/admin_ui.php b/e107_handlers/admin_ui.php index 93a3b63ae..bbd5667ad 100644 --- a/e107_handlers/admin_ui.php +++ b/e107_handlers/admin_ui.php @@ -2511,21 +2511,29 @@ class e_admin_controller_ui extends e_admin_controller */ protected function convertToData(&$data) { + $model = new e_model($data); + $data = $model->getData(); foreach ($this->getFields() as $key => $attributes) { $value = vartrue($attributes['dataPath']) ? $model->getData($attributes['dataPath']) : $model->get($data[$key]); + if(null === $value) { - continue; + //FIXME - value appears to always be NULL. + // continue; } switch($attributes['type']) { case 'datestamp': + $value = $data[$key]; //FIXME temporary fix so that dates are converted + if(!is_numeric($value)) { - $value = trim($value) ? e107::getDateConvert()->toTime($value, 'input') : 0; + $value = trim($value) ? e107::getDateConvert()->toTime($value, 'input') : 0; } + + $data[$key] = $value; //FIXME temporary fix so that date is actually saved. break; case 'ip': // TODO - ask Steve if this check is required @@ -2535,10 +2543,10 @@ class e_admin_controller_ui extends e_admin_controller } break; } + } - $data = $model->getData(); - unset($model); + unset($model); $this->toData($data); } diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index f9be90f6d..70e746a7e 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -9,9 +9,9 @@ * Form Handler * * $Source: /cvs_backup/e107_0.8/e107_handlers/form_handler.php,v $ - * $Revision: 1.103 $ - * $Date: 2009-12-23 15:12:13 $ - * $Author: secretr $ + * $Revision: 1.104 $ + * $Date: 2009-12-24 22:36:34 $ + * $Author: e107coders $ * */ @@ -1356,7 +1356,7 @@ class e_form break; case 'datestamp': - if(vartrue($parms['auto'])) + if(vartrue($parms['auto']) && ($value == null)) { $value = time(); }