MDL-52811 course: fix unit tests broken by setforcedlanguage
[moodle.git] / backup / moodle2 / restore_stepslib.php
index e0eb1f2..1814dae 100644 (file)
@@ -1895,7 +1895,7 @@ class restore_course_structure_step extends restore_structure_step {
             $data->completionnotify = 0;
         }
         $languages = get_string_manager()->get_list_of_translations(); // Get languages for quick search
-        if (!array_key_exists($data->lang, $languages)) {
+        if (isset($data->lang) && !array_key_exists($data->lang, $languages)) {
             $data->lang = '';
         }