diff --git a/lib/models/Courseware/BlockTypes/Text.php b/lib/models/Courseware/BlockTypes/Text.php index 441da891a32a3543e36935c00c892b77ffae8f9d..b72801945e69f7c8fc37a7538b25eaeb6e5991be 100644 --- a/lib/models/Courseware/BlockTypes/Text.php +++ b/lib/models/Courseware/BlockTypes/Text.php @@ -192,7 +192,7 @@ class Text extends BlockType } - return array(); + return null; }); } } diff --git a/lib/models/Courseware/ContainerTypes/ContainerType.php b/lib/models/Courseware/ContainerTypes/ContainerType.php index e358c9c95c1e03e8908f1ba8f5f9b22a1255948a..a4eae29ba823b961f1117f6c2367ce6ee9bb2940 100644 --- a/lib/models/Courseware/ContainerTypes/ContainerType.php +++ b/lib/models/Courseware/ContainerTypes/ContainerType.php @@ -199,7 +199,7 @@ abstract class ContainerType foreach ($section['blocks'] as &$block) { $block = $block_map[$block] ?? null; } - $section['blocks'] = array_filter($section['blocks']); + $section['blocks'] = array_values(array_filter($section['blocks'])); } return $payload;