Set consecutive keys for dashboard items array. Fix JS error when printing imported dashboard

This commit is contained in:
Enrique Martin 2024-02-13 11:53:35 +01:00
parent 57b50e4c85
commit 9733ac8717

View File

@ -1229,7 +1229,7 @@ class Manager implements PublicLogin
} }
if (empty($cells) === false) { if (empty($cells) === false) {
$result = array_reduce( $result = array_values(array_reduce(
$cells, $cells,
function ($carry, $item) { function ($carry, $item) {
$carry[$item['order']]['id'] = $item['id']; $carry[$item['order']]['id'] = $item['id'];
@ -1239,7 +1239,7 @@ class Manager implements PublicLogin
return $carry; return $carry;
}, },
[] []
); ));
} }
echo json_encode($result); echo json_encode($result);