Fix: [ bug #500 ] PHP Warning when creating dict line

This commit is contained in:
Regis Houssin 2012-08-18 09:57:42 +02:00
parent 058d0b1b08
commit eeb52eee0d

View File

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