From d9a439c01aebb982143fa79586da501c57cc5e88 Mon Sep 17 00:00:00 2001 From: David Mudrak Date: Mon, 4 Jan 2010 17:49:53 +0000 Subject: [PATCH] Deletes the embeded media when deleting the assessment dimension --- mod/workshop/grading/accumulative/strategy.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); } -- 2.39.5