mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix incorrectly marking the settings on aggregate graphs as invalid
This commit is contained in:
@@ -154,14 +154,12 @@ class GraphController extends WidgetController
|
||||
{
|
||||
$settings = $this->getSettings();
|
||||
|
||||
// get type
|
||||
$type = $this->getGraphType();
|
||||
|
||||
// force settings if not initialized
|
||||
if (is_null($type) || empty($settings['graph_' . $this->getGraphType(false)])) {
|
||||
if ($this->hasInvalidSettings()) {
|
||||
return $this->getSettingsView($request);
|
||||
}
|
||||
|
||||
$type = $this->getGraphType();
|
||||
$param = '';
|
||||
|
||||
if ($type == 'device') {
|
||||
@@ -224,6 +222,16 @@ class GraphController extends WidgetController
|
||||
return $type;
|
||||
}
|
||||
|
||||
private function hasInvalidSettings()
|
||||
{
|
||||
$raw_type = $this->getGraphType(false);
|
||||
if ($raw_type == 'custom' || $this->getGraphType() != 'aggregate') {
|
||||
return empty($this->getSettings()['graph_' . $raw_type]);
|
||||
}
|
||||
|
||||
return false; // non-custom aggregate types require no additional settings
|
||||
}
|
||||
|
||||
public function getSettings()
|
||||
{
|
||||
if (is_null($this->settings)) {
|
||||
|
||||
Reference in New Issue
Block a user