Project: moodle
Issue MDL-43411: showfromothers / hidefromothers error shown strings are not present but uses_sections is false
I have create a custom course format. In this format my uses_sections functions returns false. However, when I'm in turn on course editing I get the errors listed below. It seems that the strings are used by format/renderer.php when creating the icons for hiding and showing sections. However I see no check on this code to see if the format uses sections in the first place before throwing the error. Why should I need these strings if my format doesn't use sections. String does not exist. Please check your string definition for showfromothers/format_nosm_dashboard line 11423 of /lib/moodlelib.php: call to debugging() line 1088 of /lib/outputrequirementslib.php: call to lang_string->__construct() line 1124 of /lib/outputrequirementslib.php: call to page_requirements_manager->string_for_js() line 2998 of /course/lib.php: call to page_requirements_manager->strings_for_js() line 285 of /course/view.php: call to include_course_ajax() String does not exist. Please check your string definition for hidefromothers/format_nosm_dashboard line 11423 of /lib/moodlelib.php: call to debugging() line 1088 of /lib/outputrequirementslib.php: call to lang_string->__construct() line 1124 of /lib/outputrequirementslib.php: call to page_requirements_manager->string_for_js() line 2998 of /course/lib.php: call to page_requirements_manager->strings_for_js() line 285 of /course/view.php: call to include_course_ajax() Invalid get_string() identifier: 'showfromothers' or component 'format_nosm_dashboard'. Perhaps you are missing $string['showfromothers'] = ''; in /var/development/pge/moodle/mainline/course/format/nosm_dashboard/lang/en/format_nosm_dashboard.php? line 6913 of /lib/moodlelib.php: call to debugging() line 11451 of /lib/moodlelib.php: call to core_string_manager->get_string() line 11476 of /lib/moodlelib.php: call to lang_string->get_string() line 1423 of /lib/outputrequirementslib.php: call to lang_string->out() line 882 of /lib/outputrenderers.php: call to page_requirements_manager->get_end_code() line 287 of /course/view.php: call to core_renderer->footer() Invalid get_string() identifier: 'hidefromothers' or component 'format_nosm_dashboard'. Perhaps you are missing $string['hidefromothers'] = ''; in /var/development/pge/moodle/mainline/course/format/nosm_dashboard/lang/en/format_nosm_dashboard.php? line 6913 of /lib/moodlelib.php: call to debugging() line 11451 of /lib/moodlelib.php: call to core_string_manager->get_string() line 11476 of /lib/moodlelib.php: call to lang_string->get_string() line 1423 of /lib/outputrequirementslib.php: call to lang_string->out() line 882 of /lib/outputrenderers.php: call to page_requirements_manager->get_end_code() line 287 of /course/view.php: call to core_renderer->footer()
Story points: 5