From eeb52eee0d417b3d8b59a09fdca364bbd8737844 Mon Sep 17 00:00:00 2001
From: Regis Houssin <regis@dolibarr.fr>
Date: Sat, 18 Aug 2012 09:57:42 +0200
Subject: [PATCH] Fix: [ bug #500 ] PHP Warning when creating dict line

---
 htdocs/admin/dict.php | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php
index e4dead271f4..5b0ee0d7824 100644
--- a/htdocs/admin/dict.php
+++ b/htdocs/admin/dict.php
@@ -391,7 +391,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
             if ($fieldnamekey == 'decalage') $fieldnamekey='Offset';
             if ($fieldnamekey == 'module')   $fieldnamekey='Module';
             if ($fieldnamekey == 'code') $fieldnamekey = 'Code';
-            
+
             $msg.=$langs->trans("ErrorFieldRequired",$langs->transnoentities($fieldnamekey)).'<br>';
         }
     }
@@ -711,14 +711,14 @@ if ($id)
         // Line to type new values
         print "<tr ".$bc[$var].">";
 
-        $obj='';
+        $obj = (object) array();
         // If data was already input, we define them in obj to populate input fields.
         if (GETPOST('actionadd'))
         {
             foreach ($fieldlist as $key=>$val)
             {
-                if (! empty($_POST[$val])) $obj->$val=$_POST[$val];
-
+                if (GETPOST($val))
+                	$obj->$val=GETPOST($val);
             }
         }
 
-- 
GitLab