--- moodle-2.1.3/mod/data/lib.php 2011-07-14 02:04:27.000000000 +0200 +++ moodle/mod/data/lib.php 2011-11-28 15:08:42.000000000 +0100 @@ -3035,6 +3035,7 @@ * @return bool */ function data_presets_save($course, $cm, $data, $path) { + global $USER; $fs = get_file_storage(); $filerecord = new stdClass; $filerecord->contextid = DATA_PRESET_CONTEXT; @@ -3042,6 +3043,7 @@ $filerecord->filearea = DATA_PRESET_FILEAREA; $filerecord->itemid = 0; $filerecord->filepath = '/'.$path.'/'; + $filerecord->userid = $USER->id; $filerecord->filename = 'preset.xml'; $fs->create_file_from_string($filerecord, data_presets_generate_xml($course, $cm, $data));