-
Bug
-
Resolution: Fixed
-
Minor
-
2.3.1
-
MOODLE_23_STABLE
-
-
When a course is set in 'One section per page' mode and the user un-ticks 'Use default section name' for section zero and leaves it intentionally blank the default name is still displayed.
This is demonstrated by 'bad' - s0_b.png and 'good' s0_g.png.
The fault lies in '/course/format/renderer.php', where:
$hasnamesecpg = ($onsectionpage && ($section->section == 0 && !is_null($section->name)));
|
should be:
$hasnamesecpg = ($onsectionpage && ($section->section == 0 && (string)$section->name !== ''));
|
Replication steps:
- Create a course say in the 'Topics' format.
- Set to 'One section per page' in the course settings.
- Click on a topic so that it and section zero are displayed.
- Turn on editing.
- Edit section zero's summary.
- Un-tick 'Use default section name'.
- Leave the section name blank.
- Save and go back to the course to observe that the default word 'General' is displayed.