mirror of
https://github.com/moodle/moodle.git
synced 2025-02-13 12:34:28 +01:00
MDL-15405 Final bit to make forum attachments work with filepicker
This commit is contained in:
parent
a905364a0a
commit
ad78615cb3
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user