From e224144fdd697b2d04b3d908fa1841919c839cc8 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Thu, 15 Dec 2011 12:17:46 +0100 Subject: [PATCH] LSformElement::valueWithUnit : Added compatibility with data entry form --- .../includes/class/class.LSformElement_valueWithUnit.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/public_html/includes/class/class.LSformElement_valueWithUnit.php b/public_html/includes/class/class.LSformElement_valueWithUnit.php index 4503138c..50ef1b17 100644 --- a/public_html/includes/class/class.LSformElement_valueWithUnit.php +++ b/public_html/includes/class/class.LSformElement_valueWithUnit.php @@ -149,6 +149,12 @@ class LSformElement_valueWithUnit extends LSformElement { } } } + if (isset($_POST[$this -> name])) { + if(!is_array($_POST[$this -> name])) { + $_POST[$this -> name] = array($_POST[$this -> name]); + } + $return[$this -> name]=array_merge($return[$this -> name],$_POST[$this -> name]); + } if (isset($_POST[$this -> name.'_value'])) { if (!is_array($_POST[$this -> name.'_value'])) { $_POST[$this -> name.'_value']=array($_POST[$this -> name.'_value']);