MDL-15405 Final bit to make forum attachments work with filepicker

This commit is contained in:
moodler 2008-09-03 06:07:36 +00:00
parent a905364a0a
commit ad78615cb3

View File

@ -4030,13 +4030,8 @@ function forum_add_attachment($post, $cm, $mform=null, &$message=null, $remove_p
return false;
}
$filename = $mform->get_new_filename('attachment');
$filearea = 'forum_attachment';
if ($filename === false) {
return false;
}
$fs = get_file_storage();
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
@ -4047,7 +4042,7 @@ function forum_add_attachment($post, $cm, $mform=null, &$message=null, $remove_p
$DB->update_record('forum_posts', $post);
}
if ($mform->save_stored_file('attachment', $context->id, $filearea, $post->id, '/', $filename, true, $USER->id)) {
if ($mform->save_stored_file('attachment', $context->id, $filearea, $post->id, '/', null, true, $USER->id)) {
$post->attachment = '1';
$DB->update_record('forum_posts', $post);
return true;