-
Bug
-
Resolution: Won't Do
-
Minor
-
None
-
4.0.7
-
MOODLE_400_STABLE
-
MDL-78063-MOODLE_403_STABLE-fix_course_view_to_prefer_sectionid -
-
-
Hi everyone, I've found an issue in moodle/course/view.php.
Issue:
The $PAGE url is always set using the "section" parameter. Meaning you cannot use "sectionid" instead of "section" in your course format.
See: https://github.com/moodle/moodle/blob/c36636264fe8a1a1e874c675f29d221b0809d6ae/course/view.php#L45
One of the reasons we would like to use sectionid instead of section in our format:
- Open a course using format_topics in single section per page mode
- Open a section so you get the "§ion={section}" in the url
- Use the course index drawer to drag the active section to a new position in the course.
- Now refreshing the page will open another section than you were just on, as the link changed with the order of the sections in the course.
We had the same issue in our course format and fixed it by switching to sectionid, however Moodle still forces us to use section when clicking links generated from $PAGE->url.
Suggested solution:
Using the \core_courseformat\base::get_view_url($section) function to set the $PAGE url, meaning the course format get's to decide the url structure