From e2b4b56eee6ee4c35b72edb6e8f81a9a08377e31 Mon Sep 17 00:00:00 2001 From: Neill Magill Date: Mon, 31 Oct 2016 10:48:15 +0000 Subject: [PATCH] MDL-56133 tool_langimport: Changes should be visible after import Before this change if a language pack was updated by the \tool_langimport\task\update_langpacks_task scheduled task, changes would not be available to users until an admin manually cleared the strings cache. This change causes the cache to purged when a language pack it update, this will cause it to rebuild so users will start seeing updates automatically. --- admin/tool/langimport/classes/controller.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/admin/tool/langimport/classes/controller.php b/admin/tool/langimport/classes/controller.php index bf43258ae89..3ea368c9585 100644 --- a/admin/tool/langimport/classes/controller.php +++ b/admin/tool/langimport/classes/controller.php @@ -184,6 +184,8 @@ class controller { if ($updated) { $this->info[] = get_string('langupdatecomplete', 'tool_langimport'); + // The strings have been changed so we need to purge their cache to ensure users see the changes. + get_string_manager()->reset_caches(); } else { $this->info[] = get_string('nolangupdateneeded', 'tool_langimport'); }