Skip to content

Commit

Permalink
Widget: fix for when slot doesn't exist (e.g. global elements)
Browse files Browse the repository at this point in the history
  • Loading branch information
dasgarner committed Aug 6, 2023
1 parent 3f70019 commit a7af4c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Controller/Widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down

0 comments on commit a7af4c1

Please sign in to comment.