From: David Mudrak Date: Mon, 4 Jan 2010 17:49:53 +0000 (+0000) Subject: Deletes the embeded media when deleting the assessment dimension X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=d9a439c01aebb982143fa79586da501c57cc5e88;p=moodle.git Deletes the embeded media when deleting the assessment dimension --- diff --git a/mod/workshop/grading/accumulative/strategy.php b/mod/workshop/grading/accumulative/strategy.php index c23eac13da..25130b8b9d 100644 --- a/mod/workshop/grading/accumulative/strategy.php +++ b/mod/workshop/grading/accumulative/strategy.php @@ -196,7 +196,11 @@ class workshop_accumulative_strategy extends workshop_base_strategy implements w $PAGE->context, 'workshop_dimension_description', $local->id); $DB->update_record('workshop_forms_accumulative', $local); } - // todo unlink embedded files + // unlink embedded files and delete emptied dimensions + $fs = get_file_storage(); + foreach ($todeletelocal as $itemid) { + $fs->delete_area_files($PAGE->context->id, 'workshop_dimension_description', $itemid); + } $DB->delete_records_list('workshop_forms_accumulative', 'id', $todeletelocal); $DB->delete_records_list('workshop_forms', 'id', $todeletemaster); }