MDL-29086 - data - Fix for allowing the deletion of database activity presets.
Thank you to Matthias Hunstock for providing the patch for this.
This commit is contained in:
@@ -3121,6 +3121,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;
|
||||
@@ -3128,6 +3129,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));
|
||||
|
||||
Reference in New Issue
Block a user