-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
3.5
-
None
-
MOODLE_35_STABLE
when a new discussion is added, hsuforum_trigger_content_uploaded_event is triggered before files are saved into the database so the contenthashes are not included in the event.
$files = $fs->get_area_files($context->id, 'mod_hsuforum', 'attachment') returns an empty array.
This does not seem to occur when replying to an existing discussion.
it looks like the files aren't actually saved until process_file_upload is run in save_discussion()
the logic should be tidied up so that hsuforum_trigger_content_uploaded_event is only triggered when the post has been saved, and all attachments have been saved into the db.