Update "submitted only" module options
Don't update to the null value options absent from the posted parameters.
This commit is contained in:
parent
12b4909c45
commit
65cc1202ce
@ -34,11 +34,15 @@ if ($action == 'update' && is_array($arrayofparameters))
|
||||
$ok=true;
|
||||
foreach($arrayofparameters as $key => $val)
|
||||
{
|
||||
$result=dolibarr_set_const($db, $key, GETPOST($key, 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
if ($result < 0)
|
||||
// Modify constant only if key was posted (avoid resetting key to the null value)
|
||||
if (GETPOSTISSET($key))
|
||||
{
|
||||
$ok=false;
|
||||
break;
|
||||
$result=dolibarr_set_const($db, $key, GETPOST($key, 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
if ($result < 0)
|
||||
{
|
||||
$ok=false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user