Merge pull request #12922 from simicar29/simicar29-patch-2

Update "submitted only" module options
This commit is contained in:
Laurent Destailleur 2020-01-26 22:27:54 +01:00 committed by GitHub
commit 627fa996a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}
}
}