File tree 2 files changed +8
-4
lines changed
classes/output/courseformat
2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -449,7 +449,7 @@ static function save_last_section_access($courseid, $section)
449
449
}
450
450
451
451
/**
452
- * Retornar la ultima sección del usuario
452
+ * Retornar la última sección del usuario
453
453
* @param $courseid
454
454
* @return array|bool|float|int|mixed|\stdClass|string
455
455
* @throws \coding_exception
@@ -459,7 +459,11 @@ static function get_last_section_access($courseid)
459
459
global $ USER ;
460
460
461
461
$ cache = cache::make ('format_buttons ' , 'user_last_section ' );
462
- return $ cache ->get ($ USER ->id . '_ ' . $ courseid );
462
+ $ section = $ cache ->get ($ USER ->id . '_ ' . $ courseid );
463
+ if (!$ section ) {
464
+ $ section = 1 ;
465
+ }
466
+ return $ section ;
463
467
}
464
468
465
469
/**
@@ -469,7 +473,7 @@ static function get_last_section_access($courseid)
469
473
* @return array|\core_courseformat\output\local\section_info[]
470
474
* @throws \moodle_exception
471
475
*/
472
- private function get_sections_to_display (\course_modinfo $ modinfo ): array
476
+ protected function get_sections_to_display (\course_modinfo $ modinfo ): array
473
477
{
474
478
$ singlesection = $ this ->format ->get_section_number ();
475
479
if ($ singlesection ) {
Original file line number Diff line number Diff line change 26
26
27
27
$ plugin ->component = 'format_buttons ' ;
28
28
$ plugin ->release = '4.x ' ;
29
- $ plugin ->version = 2025031300 ;
29
+ $ plugin ->version = 2025031600 ;
30
30
$ plugin ->requires = 2023042400 ;
31
31
$ plugin ->maturity = MATURITY_STABLE ;
You can’t perform that action at this time.
0 commit comments