MDL-56225 mod_forum: Fix inability to edit attachments
authorDavid Mudrák <david@moodle.com>
Wed, 4 Jan 2017 09:58:44 +0000 (10:58 +0100)
committerDan Poltawski <dan@moodle.com>
Wed, 4 Jan 2017 11:34:01 +0000 (11:34 +0000)
commit1af801be98ee919870d5e773591648f585244cac
treeb52c9eb0642e6671a4e490cd2fe87f15bd24c79b
parent9afc02742bc4dfe1fd289f45bcc7fb9c46fbcb07
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.
mod/forum/lib.php