MDL-70130 core: allow to attach files from localrequestdir to emails

Co-authored-by: Paul Holden <paulh@moodle.com>
This commit is contained in:
Marina Glancy 2020-11-05 17:01:54 +01:00 committed by Andrew Nicols
parent 8a9a4ee4f3
commit e30716a16e
2 changed files with 5 additions and 1 deletions

View File

@ -6325,7 +6325,8 @@ function email_to_user($user, $from, $subject, $messagetext, $messagehtml = '',
$CFG->dataroot,
$CFG->dirroot,
$CFG->localcachedir,
$CFG->tempdir
$CFG->tempdir,
$CFG->localrequestdir,
]);
// Set addpath to true.
$addpath = true;

View File

@ -3446,6 +3446,9 @@ class core_moodlelib_testcase extends advanced_testcase {
'dirroot' => [$CFG->dirroot],
'localcachedir' => [$CFG->localcachedir],
'tempdir' => [$CFG->tempdir],
// Paths within $CFG->localrequestdir.
'localrequestdir_request_directory' => [make_request_directory()],
'localrequestdir_request_storage_directory' => [get_request_storage_directory()],
// Pass null to indicate we want to test a path relative to $CFG->dataroot.
'relative' => [null]
];