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

Duplicate section several issues

Details

    • MOODLE_402_STABLE
    • mdl-78080-402-split
    • mdl-78080-403-split
    • mdl-78080-404-split
    • mdl-78080-main-split
    • Hide

      With the standard Topics / Custom sections course

      1. Add a new course with at least 4 sections (in addition to the General section).
      2. Name the sections A, B, C, and D.
      3. Verify the General section has no duplicate option.
      4. Drag and drop to swap sections A and B.
      5. Duplicate section A.
      6. Verify there is now a section named "A (copy)", and not a section named "B (copy)".
      7. Add a Text and media area to section C.
      8. Delete the Text and media area.
      9. Duplicate section C.
      10. Verify the section named "C (copy)" does not contain a Text and media area.
      11. Edit section D, and add an image to the summary.
      12. Duplicate section D.
      13. Verify the section named "D (copy)" has the image in it's summary.

      With a Multitopic format course, plugin from GitHub https://github.com/james-cnz/moodle-format_multitopic

      1. Add a new course.
      2. Add a new topic (link at bottom of page).
      3. Edit the section 1 options, naming the section A, and setting Collapsible topic override to No.
      4. Duplicate section A.
      5. Verify section A (copy) is not collapsible.
      Show
      With the standard Topics / Custom sections course Add a new course with at least 4 sections (in addition to the General section). Name the sections A, B, C, and D. Verify the General section has no duplicate option. Drag and drop to swap sections A and B. Duplicate section A. Verify there is now a section named "A (copy)", and not a section named "B (copy)". Add a Text and media area to section C. Delete the Text and media area. Duplicate section C. Verify the section named "C (copy)" does not contain a Text and media area. Edit section D, and add an image to the summary. Duplicate section D. Verify the section named "D (copy)" has the image in it's summary. With a Multitopic format course, plugin from GitHub https://github.com/james-cnz/moodle-format_multitopic Add a new course. Add a new topic (link at bottom of page). Edit the section 1 options, naming the section A, and setting Collapsible topic override to No. Duplicate section A. Verify section A (copy) is not collapsible.

    Description

      I think the duplicate option has several issues:

      • I think the function course_update_section() is supposed to take the unaltered section info as its second argument, and just the new data as its third. Passing the altered section info twice hasn't caused any issue I've noticed, but I don't think it's good practice. (Fix course_update_section params)
      • Duplicating a section doesn't copy custom section options--this isn't an issue for the built in formats, but I'd guess most plug-in formats with custom section options will probably want them copied, so this may as well be done by default. (Copy custom section options)
      • Section summary files don't seem to be copied. I've copied code for this from the Onetopic format file duplicate.php . (Copy section summary files)
      • Activities deleted before the last cron run are copied. (Don't copy deleted activities)
      • The duplicate option is shown on the General section, but doesn't function--I think it probably makes sense to leave this option off the General section. I don't think people are likely to need to copy the General section if it's being used as intended (for whole-course resources), and it would be a bit weird in one-section-per-page mode. Either way, though, something needs to be done here. (No duplicate option for section 0)
      • It gets confused when sections are moved, and duplicates the wrong section. (Duplicate by section id, not num)

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:

                Clockify

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