Fixed web service not having access to file_save_draft_area_files()

The error occurred when editing an image element on the repositioning
page for site wide templates.
This commit is contained in:
Mark Nelson 2016-08-26 12:46:35 +08:00
parent e341d28853
commit 9fd128d5e1

View file

@ -84,7 +84,10 @@ class certificate {
* @param int $contextid the context we are storing this image in
*/
public static function upload_imagefiles($draftitemid, $contextid) {
global $CFG;
// Save the file if it exists that is currently in the draft area.
require_once($CFG->dirroot . '/lib/filelib.php');
file_save_draft_area_files($draftitemid, $contextid, 'mod_customcert', 'image', 0);
}