MDL-85433 course: Remove restriction to display course description

The "Show description" checkbox now appears even in course formats
without a dedicated view page, as this information can now be
displayed via the Additional activities block (formerly the Main
menu block), if added to the course.
This commit is contained in:
Sara Arjona
2025-06-13 15:26:08 +02:00
parent c42efe971f
commit 047bc9ec26
2 changed files with 11 additions and 4 deletions
@@ -0,0 +1,9 @@
issueNumber: MDL-85433
notes:
core_course:
- message: >-
The 'Show description' checkbox is now present in all course formats.
Activity descriptions can be displayed via the Additional activities block
(formerly the Main menu block), regardless of whether the course
format's has_view_page() function returns false.
type: changed
+2 -4
View File
@@ -1009,8 +1009,7 @@ abstract class moodleform_mod extends moodleform {
}
// If the 'show description' feature is enabled, this checkbox appears below the intro.
// We want to hide that when using the singleactivity course format because it is confusing.
if ($this->_features->showdescription && $this->courseformat->has_view_page()) {
if ($this->_features->showdescription) {
$mform->addElement('advcheckbox', 'showdescription', get_string('showdescription'));
$mform->addHelpButton('showdescription', 'showdescription');
}
@@ -1043,8 +1042,7 @@ abstract class moodleform_mod extends moodleform {
$buttonarray = array();
// Label for the submit button to return to the course.
// Ignore this button in single activity format because it is confusing.
if ($submit2label !== false && $this->courseformat->has_view_page()) {
if ($submit2label !== false) {
$buttonarray[] = &$mform->createElement('submit', 'submitbutton2', $submit2label);
}