From 33594b565d6bf836d25558978cc37ef155ce0e30 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 5 May 2014 22:19:54 +0000 Subject: [PATCH] Custom fields are not allowed to have a null value, since NULL is skipped by backend Fixes bug where it was impossible to clear date cfs --- etemplate/inc/class.etemplate_widget_customfields.inc.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/etemplate/inc/class.etemplate_widget_customfields.inc.php b/etemplate/inc/class.etemplate_widget_customfields.inc.php index f4b8e3411d..23e7266692 100644 --- a/etemplate/inc/class.etemplate_widget_customfields.inc.php +++ b/etemplate/inc/class.etemplate_widget_customfields.inc.php @@ -323,6 +323,9 @@ class etemplate_widget_customfields extends etemplate_widget_transformer $valid =& self::get_array($validated, $this->id ? $form_name : $field, true); if (is_array($valid)) $valid = implode(',', $valid); + // NULL is valid for most fields, but not custom fields due to backend handling + // See so_sql_cf->save() + if (is_null($valid)) $valid = false; //error_log(__METHOD__."() $form_name $field: ".array2string($value).' --> '.array2string($valid)); } } elseif ($this->type == 'customfields-types') {