Skip to content

Commit 1349503

Browse files
committed
fix: no graph generated, when grafanaimagefiltersarray not set
1 parent eab1d02 commit 1349503

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

library/Grafana/ProvidedHook/Icingadb/IcingaDbGrapher.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,10 @@ public function getPreviewHtml(Model $object, $report = false): ValidHtml
485485
$i++;
486486
}
487487

488-
foreach ($info as $value) {
488+
$i = 0;
489+
do {
490+
$value = $info ? $info[$i] : "";
491+
489492
// The image value will be returned as reference
490493
$previewHtml = new HtmlDocument();
491494
$res = $this->getMyPreviewHtml($serviceName, $hostName, $previewHtml, $value);
@@ -503,6 +506,8 @@ public function getPreviewHtml(Model $object, $report = false): ValidHtml
503506

504507
$html->addHtml($previewHtml);
505508
}
509+
$i++;
510+
} while ($i < count($info));
506511

507512
$returnHtml->add($html);
508513
}

0 commit comments

Comments
 (0)