From efa66e0597137e9514d74b2c8a30e2a85c8c1bc4 Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Wed, 21 Feb 2018 20:53:19 +0100 Subject: [PATCH] MDL-55153 customlang: Remove local DB entries when deleting local file --- admin/tool/customlang/locallib.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/admin/tool/customlang/locallib.php b/admin/tool/customlang/locallib.php index 02ae558dcb8..83e879a866d 100644 --- a/admin/tool/customlang/locallib.php +++ b/admin/tool/customlang/locallib.php @@ -159,6 +159,11 @@ class tool_customlang_utils { $needsupdate = true; $current[$stringid]->local = $stringlocal; $current[$stringid]->timecustomized = $now; + } else if (isset($currentlocal) && $stringlocal !== $currentlocal) { + // If local string has been removed, we need to remove also the old local value from DB. + $needsupdate = true; + $current[$stringid]->local = null; + $current[$stringid]->timecustomized = $now; } if ($needsupdate) {