MDL-80258 course: don't re-request the current category theme.

This commit is contained in:
Paul Holden
2024-02-14 12:12:37 +00:00
parent cd655be112
commit a36c27c709
+3 -4
View File
@@ -629,10 +629,9 @@ class core_course_category implements renderable, cacheable_object, IteratorAggr
}
// Delete theme usage cache if the theme has been changed.
if (isset($data->theme)) {
$oldcategory = $DB->get_record('course_categories', ['id' => $data->id]);
if ($data->theme != $oldcategory->theme) {
theme_delete_used_in_context_cache($data->theme, (string)$oldcategory->theme);
if (isset($newcategory->theme)) {
if ($newcategory->theme != $this->theme) {
theme_delete_used_in_context_cache($newcategory->theme, (string) $this->theme);
}
}