mirror of
https://github.com/moodle/moodle.git
synced 2025-01-29 19:50:14 +01:00
Merge branch 'MDL-78196-401' of https://github.com/jleyva/moodle into MOODLE_401_STABLE
This commit is contained in:
commit
732f27c770
@ -1214,8 +1214,10 @@ class core_user_external extends external_api {
|
||||
$maxbytes = USER_CAN_IGNORE_FILE_SIZE_LIMITS;
|
||||
$maxareabytes = FILE_AREA_MAX_BYTES_UNLIMITED;
|
||||
} else {
|
||||
// Get current used space for this user.
|
||||
$usedspace = file_get_user_used_space();
|
||||
// Get current used space for this user (private files only).
|
||||
$fileareainfo = file_get_file_area_info($context->id, 'user', 'private');
|
||||
$usedspace = $fileareainfo['filesize_without_references'];
|
||||
|
||||
// Get the total size of the new files we want to add to private files.
|
||||
$newfilesinfo = file_get_draft_area_info($params['draftid']);
|
||||
|
||||
|
@ -1057,7 +1057,8 @@ class externallib_test extends externallib_advanced_testcase {
|
||||
core_user_external::add_user_private_files($draftid);
|
||||
|
||||
// Force the quota so we are sure it won't be space to add the new file.
|
||||
$CFG->userquota = file_get_user_used_space() + 1;
|
||||
$fileareainfo = file_get_file_area_info($contextid, 'user', 'private');
|
||||
$CFG->userquota = $fileareainfo['filesize_without_references'] + 1;
|
||||
|
||||
// Generate a new draftitemid for the same testfile.
|
||||
$draftfile = core_files_external::upload($contextid, $component, $filearea, $itemid, $filepath,
|
||||
|
Loading…
x
Reference in New Issue
Block a user