diff --git a/lib/classes/JsonApi/Routes/Courseware/StructuralElementsCreate.php b/lib/classes/JsonApi/Routes/Courseware/StructuralElementsCreate.php index 42831116d79ab3f2c90c67a14e47cd8c2d39ea72..496a8f7001f7078506d8507f82339f37990c0c7b 100644 --- a/lib/classes/JsonApi/Routes/Courseware/StructuralElementsCreate.php +++ b/lib/classes/JsonApi/Routes/Courseware/StructuralElementsCreate.php @@ -123,6 +123,20 @@ class StructuralElementsCreate extends JsonApiController $new_container['payload'] = $new_container->type->copyPayload($blockMap); $new_container->store(); } + } else { + $new_container = \Courseware\Container::build([ + 'structural_element_id' => $struct->id, + 'owner_id' => $user->id, + 'editor_id' => $user->id, + 'edit_blocker_id' => '', + 'position' => 0, + 'container_type' => 'list', + 'payload' => json_encode([ + 'colspan' => 'full', + 'sections' => [['name' => _('erstes Element'),'icon'=> '','blocks' =>[]]] + ]), + ]); + $new_container->store(); } return $struct;