From 34492bec744d1eb11260069e66b3e639faef0745 Mon Sep 17 00:00:00 2001 From: Alexander Van der Bellen Date: Tue, 13 Feb 2024 17:01:23 +0800 Subject: [PATCH] MDL-80917 core_backup: Clear restored course cache --- lib/classes/task/asynchronous_copy_task.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/classes/task/asynchronous_copy_task.php b/lib/classes/task/asynchronous_copy_task.php index 21aa877b341..323ee3e356d 100644 --- a/lib/classes/task/asynchronous_copy_task.php +++ b/lib/classes/task/asynchronous_copy_task.php @@ -26,6 +26,7 @@ namespace core\task; use async_helper; +use cache_helper; defined('MOODLE_INTERNAL') || die(); @@ -207,6 +208,9 @@ class asynchronous_copy_task extends adhoc_task { fulldelete($backupbasepath); } + rebuild_course_cache($restorerecord->itemid, true); + cache_helper::purge_by_event('changesincourse'); + $duration = time() - $started; mtrace('Course copy: Copy completed in: ' . $duration . ' seconds'); }