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

Prefer section IDs over section nums in course format code

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • Future Dev
    • Course
    • mdl-82709_main_wip
    • Hide
      1. Change the theme to Boost, if it isn't already (Site admin > Appearance > Themes > Boost > Select theme).
      2. Create a new Custom sections course with 2 sections (other than the General section).
      3. Verify the General section is titled "General" and the two other sections are titled "New section".
      4. Change the name of the first new section to "A".
      5. Verify the section name is correctly displayed as "A".
      6. Hide section A.
      7. Verify section A is marked as hidden.
      8. Show section A.
      9. Verify section A is not marked as hidden.
      10. Drag section A after the new section.
      11. Verify section A is shown after the new section.
      12. Use the section A menu option to move section A after the General section.
      13. Verify section A is shown after the General section.
      14. Add a Page activity to the new section.
      15. Verify a Page activity is shown in the new section.
      16. Click the section A link in the course index.
      17. Verify the section A page is displayed.
      18. Click the course name in the breadcrumbs.
      19. Convert the course to weekly format.
      20. Verify the General section is titled "General", the next section is titled "A", and the final section is titled with a date.
      21. Change name of the final section to "B".
      22. Verify the name of the final section is correctly displayed as "B".
      23. Hide section A.
      24. Verify section A is marked as hidden.
      25. Show section A.
      26. Verify section A is not marked as hidden.
      27. Drag section A after section B.
      28. Verify section A is shown after section B.
      29. Use the section A menu option to move section A after the General section.
      30. Verify section A is shown after the General section.
      31. Change the theme to Classic (Site admin > Appearance > Themes > Classic > Select theme).
      32. Return to the course.
      33. Click the section A link in the course index.
      34. Verify the section A page is displayed.
      35. Verify the section selector list Jump to... contains Main course page, General, and B.
      36. Click the course name in the breadcrumbs.
      37. Convert the course to single activity format.
      38. Check a Page activity is listed under the Orphaned section.
      39. Go to Site admin > Site home > Site home settings.
      40. Enable Add custom content, if not already enabled.
      41. Go to site home.
      42. Change the site section name.
      43. Verify the new name is displayed.
      Show
      Change the theme to Boost, if it isn't already (Site admin > Appearance > Themes > Boost > Select theme). Create a new Custom sections course with 2 sections (other than the General section). Verify the General section is titled "General" and the two other sections are titled "New section". Change the name of the first new section to "A". Verify the section name is correctly displayed as "A". Hide section A. Verify section A is marked as hidden. Show section A. Verify section A is not marked as hidden. Drag section A after the new section. Verify section A is shown after the new section. Use the section A menu option to move section A after the General section. Verify section A is shown after the General section. Add a Page activity to the new section. Verify a Page activity is shown in the new section. Click the section A link in the course index. Verify the section A page is displayed. Click the course name in the breadcrumbs. Convert the course to weekly format. Verify the General section is titled "General", the next section is titled "A", and the final section is titled with a date. Change name of the final section to "B". Verify the name of the final section is correctly displayed as "B". Hide section A. Verify section A is marked as hidden. Show section A. Verify section A is not marked as hidden. Drag section A after section B. Verify section A is shown after section B. Use the section A menu option to move section A after the General section. Verify section A is shown after the General section. Change the theme to Classic (Site admin > Appearance > Themes > Classic > Select theme). Return to the course. Click the section A link in the course index. Verify the section A page is displayed. Verify the section selector list Jump to... contains Main course page, General, and B. Click the course name in the breadcrumbs. Convert the course to single activity format. Check a Page activity is listed under the Orphaned section. Go to Site admin > Site home > Site home settings. Enable Add custom content, if not already enabled. Go to site home. Change the site section name. Verify the new name is displayed.
    • Hide

      Code verified against automated checks.

      Checked MDL-82709 using repository: https://github.com/james-cnz/moodle

      More information about this report

      Built on: Wed Apr 23 05:25:23 UTC 2025

      Show
      Code verified against automated checks. Checked MDL-82709 using repository: https://github.com/james-cnz/moodle main (0 errors / 0 warnings) [branch: mdl-82709_main_wip | CI Job ] More information about this report Built on: Wed Apr 23 05:25:23 UTC 2025

      I think it would be better to use section IDs rather than section nums where possible.  Use of nums can cause issues, e.g. in MDL-78080 and MDL-82679, and I think Moodle is generally shifting to prefer section IDs now?

      I had a quick look through the course format code, and replaced section nums with IDs where I saw an obvious way to do it easily, without changing any function signatures or anything.

            james-cnz James E. Calder
            james-cnz James E. Calder
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

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