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

@ -33,6 +33,9 @@ if ($action == 'update' && is_array($arrayofparameters))
$ok=true; $ok=true;
foreach($arrayofparameters as $key => $val) foreach($arrayofparameters as $key => $val)
{
// Modify constant only if key was posted (avoid resetting key to the null value)
if (GETPOSTISSET($key))
{ {
$result=dolibarr_set_const($db, $key, GETPOST($key, 'alpha'), 'chaine', 0, '', $conf->entity); $result=dolibarr_set_const($db, $key, GETPOST($key, 'alpha'), 'chaine', 0, '', $conf->entity);
if ($result < 0) if ($result < 0)
@ -41,6 +44,7 @@ if ($action == 'update' && is_array($arrayofparameters))
break; break;
} }
} }
}
if (! $error) if (! $error)
{ {