LSformElement::valueWithUnit : Added compatibility with data entry form
authorBenjamin Renard <brenard@easter-eggs.com>
Thu, 15 Dec 2011 11:17:46 +0000 (12:17 +0100)
committerBenjamin Renard <brenard@easter-eggs.com>
Thu, 15 Dec 2011 11:17:46 +0000 (12:17 +0100)
public_html/includes/class/class.LSformElement_valueWithUnit.php

index 4503138..50ef1b1 100644 (file)
@@ -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']);