From a7af4c1d43c39fd21bddf6495d2eaeecce0b82e3 Mon Sep 17 00:00:00 2001 From: Dan Garner Date: Sun, 6 Aug 2023 13:56:08 +0100 Subject: [PATCH] Widget: fix for when slot doesn't exist (e.g. global elements) --- lib/Controller/Widget.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Controller/Widget.php b/lib/Controller/Widget.php index 32f86483c2..2c571e6208 100644 --- a/lib/Controller/Widget.php +++ b/lib/Controller/Widget.php @@ -1551,7 +1551,7 @@ public function saveElements(Request $request, Response $response, $id) $uniqueSlots = 0; foreach ($elementJson as $widgetElement) { foreach ($widgetElement['elements'] ?? [] as $element) { - $slotNo = 'slot_' . $element['slot'] ?? 0; + $slotNo = 'slot_' . ($element['slot'] ?? 0); if (!in_array($slotNo, $slots)) { $slots[] = $slotNo; $uniqueSlots++;