mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix Dummy alert transport (#10379)
This commit is contained in:
@@ -40,6 +40,9 @@ class Dummy extends Transport
|
||||
|
||||
public static function configTemplate()
|
||||
{
|
||||
return [];
|
||||
return [
|
||||
'validation' => [],
|
||||
'config' => [],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@@ -91,18 +91,16 @@ if (empty($name)) {
|
||||
}
|
||||
$status = 'error';
|
||||
} else {
|
||||
$transport_config = json_decode(dbFetchCell('SELECT transport_config FROM alert_transports WHERE transport_id=?', [$transport_id]), true);
|
||||
$transport_config = (array)json_decode(dbFetchCell('SELECT transport_config FROM alert_transports WHERE transport_id=?', [$transport_id]), true);
|
||||
foreach ($result['config'] as $tmp_config) {
|
||||
if (isset($tmp_config['name']) && $tmp_config['type'] !== 'hidden') {
|
||||
$transport_config[$tmp_config['name']] = $vars[$tmp_config['name']];
|
||||
}
|
||||
}
|
||||
//Update the json config field
|
||||
if ($transport_config) {
|
||||
$transport_config = json_encode($transport_config);
|
||||
$detail = [
|
||||
'transport_type' => $transport_type,
|
||||
'transport_config' => $transport_config
|
||||
'transport_config' => json_encode($transport_config)
|
||||
];
|
||||
$where = 'transport_id=?';
|
||||
|
||||
@@ -110,10 +108,6 @@ if (empty($name)) {
|
||||
|
||||
$status = 'ok';
|
||||
$message = 'Updated alert transports';
|
||||
} else {
|
||||
$status = 'error';
|
||||
$message = 'There was an issue with the transport config';
|
||||
}
|
||||
}
|
||||
if ($status == 'error' && $newEntry) {
|
||||
//If error, we will have to delete the new entry in alert_transports tbl
|
||||
|
Reference in New Issue
Block a user