aboutsummaryrefslogtreecommitdiff
path: root/lib/models/Courseware/Block.php
diff options
context:
space:
mode:
authorElmar Ludwig <elmar.ludwig@uni-osnabrueck.de>2023-07-14 06:22:17 +0000
committerDavid Siegfried <david.siegfried@uni-vechta.de>2023-07-14 06:22:17 +0000
commit2e40475f6dae7bece3a5523c3cd499c845f69029 (patch)
tree88619a83fd3af50e80d4f7895eebef869278ffba /lib/models/Courseware/Block.php
parent74603117e50e764dfb0233d49cb99ffafaccac54 (diff)
avoid API change in BlockType class, re #2766
Merge request studip/studip!1927
Diffstat (limited to 'lib/models/Courseware/Block.php')
-rw-r--r--lib/models/Courseware/Block.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/models/Courseware/Block.php b/lib/models/Courseware/Block.php
index d311e0f..f5d8b20 100644
--- a/lib/models/Courseware/Block.php
+++ b/lib/models/Courseware/Block.php
@@ -178,7 +178,7 @@ class Block extends \SimpleORMap implements \PrivacyObject
]
];
- return json_encode($block, true);
+ return json_encode($block);
}
/**
@@ -218,18 +218,18 @@ class Block extends \SimpleORMap implements \PrivacyObject
$struct = $container->structural_element;
$rangeId = $struct->getRangeId();
- $block = self::create([
+ $block = self::build([
'container_id' => $container->id,
'owner_id' => $user->id,
'editor_id' => $user->id,
'edit_blocker_id' => null,
'position' => $container->countBlocks(),
'block_type' => $data->attributes->{'block-type'},
+ 'payload' => json_encode($data->attributes->payload),
'visible' => 1,
]);
- $dataPayload = (array)$data->attributes->payload;
- $block->payload = json_encode($block->type->copyPayload('', $dataPayload), true);
+ $block->payload = json_encode($block->type->copyPayload($rangeId));
$block->store();
//update Container payload