From 3ad9e3c420e00817d238bda2c38d5d4246a998c9 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Mon, 17 Feb 2020 08:19:36 +0100 Subject: [PATCH] Fixed error event history VC --- .../models/VisualConsole/Items/EventsHistory.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pandora_console/include/rest-api/models/VisualConsole/Items/EventsHistory.php b/pandora_console/include/rest-api/models/VisualConsole/Items/EventsHistory.php index 4ea15c15ac..55df83c953 100644 --- a/pandora_console/include/rest-api/models/VisualConsole/Items/EventsHistory.php +++ b/pandora_console/include/rest-api/models/VisualConsole/Items/EventsHistory.php @@ -102,6 +102,19 @@ final class EventsHistory extends Item throw new \InvalidArgumentException('missing agent Id'); } + if ((int) $data['width'] === 0 && (int) $data['height'] === 0) { + $data['width'] = 420; + $data['height'] = 80; + } + + if ((int) $data['width'] < 10) { + $data['width'] = 10; + } + + if ((int) $data['height'] < 5) { + $data['height'] = 5; + } + // Use the same HTML output as the old VC. $html = \graph_graphic_moduleevents( $agentId,