We are upgrading our Moodle instance from version 3.1 to 3.3.
We have many courses (more than 100) with orphaned activities (hundreds of them) . I understand that after the upgrade their sections will be visible. I've read about Stealth_activities, but it's not feasible for us to do the conversion one activity at a time for so many activities and courses.
Is there a script, or DB query, that can help us do this in bulk?
Alternatively, I see that in the get_last_section_number function in course/format/lib.php there is a check for $course->numsections:
$course = $this->get_course();But I event though these courses do have numsections defined in the DB, the check returns FALSE because apparently the code does'n't return them. Is there any way I can override some function and make the check return TRUE?
if (isset($course->numsections)) {
return $course->numsections;
}