From 9733ac871777d9468d908d5b6b441f14910b6262 Mon Sep 17 00:00:00 2001 From: Enrique Martin Date: Tue, 13 Feb 2024 11:53:35 +0100 Subject: [PATCH] Set consecutive keys for dashboard items array. Fix JS error when printing imported dashboard --- pandora_console/include/lib/Dashboard/Manager.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/lib/Dashboard/Manager.php b/pandora_console/include/lib/Dashboard/Manager.php index 670487081d..7f879c97de 100644 --- a/pandora_console/include/lib/Dashboard/Manager.php +++ b/pandora_console/include/lib/Dashboard/Manager.php @@ -1229,7 +1229,7 @@ class Manager implements PublicLogin } if (empty($cells) === false) { - $result = array_reduce( + $result = array_values(array_reduce( $cells, function ($carry, $item) { $carry[$item['order']]['id'] = $item['id']; @@ -1239,7 +1239,7 @@ class Manager implements PublicLogin return $carry; }, [] - ); + )); } echo json_encode($result);