Merge remote-tracking branch 'origin/develop' into ent-3445-Solucionar_problematica_flip_flop

Former-commit-id: d0667e3686d186a79fe7525f73a770257eaaf883
This commit is contained in:
Daniel Barbero Martin 2019-04-02 15:39:32 +02:00
commit 7be3d5fa58
2 changed files with 8 additions and 11 deletions

View File

@ -81,6 +81,11 @@ function config_update_value($token, $value)
$value = ($value); $value = ($value);
} }
if (!isset($config[$token])) {
$config[$token] = $value;
return (bool) config_create_value($token, io_safe_input($value));
}
// If it has not changed. // If it has not changed.
if ($config[$token] == $value) { if ($config[$token] == $value) {
return true; return true;
@ -95,18 +100,10 @@ function config_update_value($token, $value)
['token' => $token] ['token' => $token]
); );
if ($result == 0) { if ($result === 0) {
return true; return true;
} else { } else {
if (!isset($config[$token])) { return (bool) $result;
$config[$token] = $value;
return (bool) config_create_value(
$token,
io_safe_input($value)
);
} else {
return (bool) $result;
}
} }
} }

View File

@ -565,7 +565,7 @@ if (!empty($network_interfaces)) {
$sqlLast_contact = sprintf( $sqlLast_contact = sprintf(
' '
SELECT last_try SELECT timestamp
FROM tagente_estado FROM tagente_estado
WHERE id_agente_modulo = '.$interface['status_module_id'] WHERE id_agente_modulo = '.$interface['status_module_id']
); );