Skip to content

Commit 7f69cb8

Browse files
committed
Build draftid for messages, not for a description.
introeditor are used for module descriptions. Post messages need another draftid to wrap videos properly.
1 parent 29ac2cd commit 7f69cb8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

classes/post/post.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ public function moodleoverflow_add_new_post(): bool|int|null {
272272

273273
// Save draft files to permanent file area.
274274
$context = \context_module::instance($this->get_coursemodule()->id);
275-
$draftid = file_get_submitted_draft_itemid('introeditor');
275+
$draftid = file_get_submitted_draft_itemid('message');
276276
$this->message = file_save_draft_area_files(
277277
$draftid,
278278
$context->id,
@@ -420,7 +420,7 @@ public function moodleoverflow_edit_post(int $time, string $postmessage, int $me
420420

421421
// Update the message and save draft files to permanent file area.
422422
$context = \context_module::instance($this->get_coursemodule()->id);
423-
$draftid = file_get_submitted_draft_itemid('introeditor');
423+
$draftid = file_get_submitted_draft_itemid('message');
424424
$this->message = file_save_draft_area_files(
425425
$draftid,
426426
$context->id,

0 commit comments

Comments
 (0)