From 57bd23f94c84f274e7888b94c3dba5722e3d4fb4 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Tue, 29 Nov 2022 16:45:44 +0100 Subject: [PATCH] #9873 Fixed images --- .../include/rest-api/models/VisualConsole/Item.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/rest-api/models/VisualConsole/Item.php b/pandora_console/include/rest-api/models/VisualConsole/Item.php index be075d5e75..c132be2885 100644 --- a/pandora_console/include/rest-api/models/VisualConsole/Item.php +++ b/pandora_console/include/rest-api/models/VisualConsole/Item.php @@ -2296,6 +2296,7 @@ class Item extends CachedModel false ); + $aux_images = $all_images; foreach ($all_images as $image_file) { $image_file = substr($image_file, 0, (strlen($image_file) - 4)); @@ -2311,7 +2312,11 @@ class Item extends CachedModel continue; } - $result[$image_file] = $image_file; + // Check the 4 images. + $array_images = preg_grep('/'.$image_file.'(_ok|_bad|_warning)*\./', $aux_images); + if (count($array_images) >= 4) { + $result[$image_file] = $image_file; + } } }