mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 20:42:22 +02:00
MDL-56225 mod_forum: Fix inability to edit attachments
The 'attachments' is not a real DB field here. It comes from the form's filepicker and holds the id of the attachments filearea. The function forum_add_attachment() expects it as a property of the first argument. There were two possible approaches here. Either to pass the raw $newpost to forum_add_attachment(), or add the attachments into the list modifiable fields. The second approach is safer.
This commit is contained in:
parent
9afc02742b
commit
1af801be98
@ -4428,6 +4428,7 @@ function forum_update_post($newpost, $mform, $unused = null) {
|
||||
'timestart',
|
||||
'timeend',
|
||||
'pinned',
|
||||
'attachments',
|
||||
];
|
||||
foreach ($modifiablefields as $field) {
|
||||
if (isset($newpost->{$field})) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user