@@ -1049,22 +1049,24 @@ public function course_format_options($foreditform = false): array {
10491049 ];
10501050 }
10511051 if ($ foreditform && !isset ($ courseformatoptions ['hiddensections ' ]['label ' ])) { // CHANGED.
1052- $ hiddensectionslist = new core \output \choicelist ();
1053- $ hiddensectionslist ->set_allow_empty (false );
1054- $ hiddensectionslist ->add_option (
1055- 1 ,
1056- new lang_string ('hiddensectionsinvisible ' ),
1057- [
1058- 'description ' => new lang_string ('hiddensectionsinvisible_description ' ),
1059- ],
1060- );
1061- $ hiddensectionslist ->add_option (
1062- 0 ,
1063- new lang_string ('hiddensectionscollapsed ' ),
1064- [
1065- 'description ' => new lang_string ('hiddensectionscollapsed_description ' ),
1066- ],
1067- );
1052+ if ($ CFG ->version >= 2025082900 ) {
1053+ $ hiddensectionslist = new core \output \choicelist ();
1054+ $ hiddensectionslist ->set_allow_empty (false );
1055+ $ hiddensectionslist ->add_option (
1056+ 1 ,
1057+ new lang_string ('hiddensectionsinvisible ' ),
1058+ [
1059+ 'description ' => new lang_string ('hiddensectionsinvisible_description ' ),
1060+ ],
1061+ );
1062+ $ hiddensectionslist ->add_option (
1063+ 0 ,
1064+ new lang_string ('hiddensectionscollapsed ' ),
1065+ [
1066+ 'description ' => new lang_string ('hiddensectionscollapsed_description ' ),
1067+ ],
1068+ );
1069+ }
10681070
10691071 $ courseformatoptionsedit = [
10701072 // INCLUDED /course/format/periods/lib.php function course_format_options $foreditform 'periodduration' .
0 commit comments