mirror of
https://github.com/moodle/moodle.git
synced 2025-01-29 11:46:19 +01:00
MDL-33322 Filepicker: fix filepicker for recent file with JS turned of
This commit is contained in:
parent
4631e39533
commit
4239150a60
@ -67,7 +67,7 @@ $draftpath = optional_param('draftpath', '/', PARAM_PATH);
|
||||
|
||||
|
||||
// user context
|
||||
$user_context = get_context_instance(CONTEXT_USER, $USER->id);
|
||||
$user_context = context_user::instance($USER->id);
|
||||
|
||||
$PAGE->set_context($user_context);
|
||||
if (!$course = $DB->get_record('course', array('id'=>$courseid))) {
|
||||
@ -298,7 +298,14 @@ case 'download':
|
||||
$record->itemid = $itemid;
|
||||
$record->license = '';
|
||||
$record->author = '';
|
||||
$record->source = $thefile['url'];
|
||||
|
||||
$now = time();
|
||||
$record->timecreated = $now;
|
||||
$record->timemodified = $now;
|
||||
$record->userid = $USER->id;
|
||||
$record->contextid = $user_context->id;
|
||||
|
||||
$record->source = serialize((object)array('source' => $thefile['url']));
|
||||
try {
|
||||
$info = repository::move_to_filepool($thefile['path'], $record);
|
||||
redirect($home_url, get_string('downloadsucc', 'repository'));
|
||||
|
Loading…
x
Reference in New Issue
Block a user