Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'wip-MDL-29086-MOODLE_22_STABLE' of git://github.com/abg…

…reeve/moodle into MOODLE_22_STABLE
  • Loading branch information...
commit 26158557130f602ef49560bc5c6f17369d30de31 2 parents c904abc + d1deac2
@stronk7 stronk7 authored
Showing with 3 additions and 2 deletions.
  1. +2 −0  mod/data/lib.php
  2. +1 −2  mod/data/preset.php
View
2  mod/data/lib.php
@@ -3118,6 +3118,7 @@ function data_extend_settings_navigation(settings_navigation $settings, navigati
* @return bool
*/
function data_presets_save($course, $cm, $data, $path) {
+ global $USER;
$fs = get_file_storage();
$filerecord = new stdClass;
$filerecord->contextid = DATA_PRESET_CONTEXT;
@@ -3125,6 +3126,7 @@ function data_presets_save($course, $cm, $data, $path) {
$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));
View
3  mod/data/preset.php
@@ -183,8 +183,7 @@
print_error('invalidrequest');
}
- $presetpath = data_preset_path($course, $userid, $shortname);
- fulldelete($presetpath);
+ data_delete_site_preset($shortname);
$strdeleted = get_string('deleted', 'data');
echo $OUTPUT->notification("$shortname $strdeleted", 'notifysuccess');
Please sign in to comment.
Something went wrong with that request. Please try again.