MDL-38633 folder: support show_expanded in backup.
[moodle.git] / mod / folder / backup / moodle2 / restore_folder_stepslib.php
index 6c655e4..2618be2 100644 (file)
@@ -48,6 +48,11 @@ class restore_folder_activity_structure_step extends restore_activity_structure_
         $data->course = $this->get_courseid();
         $data->timemodified = $this->apply_date_offset($data->timemodified);
 
+        // If show_expanded is not set, apply site default.
+        if (!isset($data->show_expanded)) {
+            $data->show_expanded = get_config('folder', 'show_expanded');
+        }
+
         // insert the folder record
         $newitemid = $DB->insert_record('folder', $data);
         // immediately after inserting "activity" record, call this