Skip to content

Commit

Permalink
CTP-3973 correct cache clear
Browse files Browse the repository at this point in the history
  • Loading branch information
watson8 committed Oct 29, 2024
1 parent 1b81320 commit 5f1eb38
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 4 additions & 0 deletions classes/controllers/feedback_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,10 @@ protected function update_feedback() {

} else {
$teacherfeedback->destroy();
// Clear cache.
\mod_coursework\models\feedback::remove_cache($this->submission->courseworkid);
\mod_coursework\models\submission::remove_cache($this->submission->courseworkid);

// Remove associated files
$fs = get_file_storage();
$fs->delete_area_files($teacherfeedback->get_coursework()->get_context()->id, 'mod_coursework', 'feedback', $teacherfeedback->id());
Expand Down
3 changes: 0 additions & 3 deletions classes/framework/table_base.php
Original file line number Diff line number Diff line change
Expand Up @@ -456,9 +456,6 @@ public function destroy() {
$this->before_destroy();

$DB->delete_records(static::get_table_name(), ['id' => $this->id]);
// Clear cache.
\mod_coursework\models\feedback::remove_cache($this->submission->courseworkid);
\mod_coursework\models\submission::remove_cache($this->submission->courseworkid);
}

/**
Expand Down

0 comments on commit 5f1eb38

Please sign in to comment.