Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-31532 restore: avoid null course->hiddensections problems. Credit…

… goes to Petri Asikainen. Thanks!
  • Loading branch information...
commit 7116d8d3a7c5751f9d74e5cb1562063482ea0146 1 parent e0d5a17
@stronk7 stronk7 authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 backup/moodle2/restore_stepslib.php
View
6 backup/moodle2/restore_stepslib.php
@@ -1121,6 +1121,12 @@ public function process_course($data) {
unset($data->idnumber);
}
+ // Any empty value for course->hiddensections will lead to 0 (default, show collapsed).
+ // It has been reported that some old 1.9 courses may have it null leading to DB error. MDL-31532
+ if (empty($data->hiddensections)) {
+ $data->hiddensections = 0;
+ }
+
// Only restrict modules if original course was and target site too for new courses
$data->restrictmodules = $data->restrictmodules && !empty($CFG->restrictmodulesfor) && $CFG->restrictmodulesfor == 'all';
Please sign in to comment.
Something went wrong with that request. Please try again.