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;
|
$ok=true;
|
||||||
foreach($arrayofparameters as $key => $val)
|
foreach($arrayofparameters as $key => $val)
|
||||||
{
|
{
|
||||||
$result=dolibarr_set_const($db, $key, GETPOST($key, 'alpha'), 'chaine', 0, '', $conf->entity);
|
// Modify constant only if key was posted (avoid resetting key to the null value)
|
||||||
if ($result < 0)
|
if (GETPOSTISSET($key))
|
||||||
{
|
{
|
||||||
$ok=false;
|
$result=dolibarr_set_const($db, $key, GETPOST($key, 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
break;
|
if ($result < 0)
|
||||||
|
{
|
||||||
|
$ok=false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user