@@ -193,7 +193,8 @@ public function load_generic_course_sections(stdClass $course, navigation_node $
193193 || (
194194 !$ this ->innershowemptysections
195195 && !$ section ->hasactivites && !$ sectionextra ->hassubsections
196- && ($ this ->innerincludesectionid !== $ section ->id )
196+ && ($ this ->inner ->includesectionnum != $ section ->section )
197+ && ($ this ->innerincludesectionid != $ section ->id )
197198 )
198199 ) {
199200 // CHANGED ABOVE: Use sanitised visibility, check for subsections, and use section ID.
@@ -239,8 +240,9 @@ public function load_generic_course_sections(stdClass $course, navigation_node $
239240 }
240241
241242 if (
242- isset ($ this ->innerincludesectionid ) && ($ this ->innerincludesectionid == $ section ->id )
243- || $ sectionextra ->hassubsections // TODO: Replace with is_section_in_breadcrumbs?
243+ ($ this ->inner ->includesectionnum == $ section ->section )
244+ || ($ this ->innerincludesectionid == $ section ->id ) // TODO: Replace with is_section_in_breadcrumbs?
245+ || $ sectionextra ->hassubsections
244246 // CHANGED ABOVE: Use section ID.
245247 // Also check for subsections, because activities might not get loaded otherwise.
246248 ) {
@@ -260,7 +262,7 @@ public function load_generic_course_sections(stdClass $course, navigation_node $
260262 *
261263 * @param navigation_node $sectionnode
262264 * @param section_info $section
263- * @param stdClass[] $activitiesdata An array of activites as returned by see global_navigation::generate_sections_and_activities()
265+ * @param stdClass[] $activitiesdata Array of objects containing activities data indexed by cmid.
264266 * @return stdClass[] Array of activity nodes
265267 */
266268 protected function load_section_activities_navigation (
0 commit comments