Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-78063

course/view.php does not support sectionid instead of section

XMLWordPrintable

      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:

      1. Open a course using format_topics in single section per page mode
      2. Open a section so you get the "&section={section}" in the url
      3. Use the course index drawer to drag the active section to a new position in the course.
      4. 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

            frederikmillingpytlick Frederik Milling Pytlick
            frederikmillingpytlick Frederik Milling Pytlick
            Laurent David Laurent David
            Votes:
            0 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 20 minutes
                2h 20m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.