Fix $ok is not used
This commit is contained in:
parent
d1af419d02
commit
69479584ed
@ -21,7 +21,7 @@
|
|||||||
* \brief Code for actions on setting notes of object page
|
* \brief Code for actions on setting notes of object page
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// $error must have been initialized to 0
|
||||||
// $action must be defined
|
// $action must be defined
|
||||||
// $arrayofparameters must be set for action 'update'
|
// $arrayofparameters must be set for action 'update'
|
||||||
// $nomessageinupdate can be set to 1
|
// $nomessageinupdate can be set to 1
|
||||||
@ -31,7 +31,6 @@ if ($action == 'update' && is_array($arrayofparameters))
|
|||||||
{
|
{
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$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)
|
// Modify constant only if key was posted (avoid resetting key to the null value)
|
||||||
@ -40,7 +39,7 @@ if ($action == 'update' && is_array($arrayofparameters))
|
|||||||
$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)
|
||||||
{
|
{
|
||||||
$ok = false;
|
$error++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -93,7 +92,11 @@ if ($action == 'setModuleOptions')
|
|||||||
if (!$tmpdir) {
|
if (!$tmpdir) {
|
||||||
unset($listofdir[$key]); continue;
|
unset($listofdir[$key]); continue;
|
||||||
}
|
}
|
||||||
if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0);
|
if (!is_dir($tmpdir)) {
|
||||||
|
if (empty($nomessageinsetmoduleoptions)) {
|
||||||
|
setEventMessages($langs->trans("ErrorDirNotFound", $tmpdir), null, 'warnings');
|
||||||
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
$upload_dir = $tmpdir;
|
$upload_dir = $tmpdir;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user