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

Duplicate section several issues

XMLWordPrintable

    • MOODLE_402_STABLE, MOODLE_404_STABLE
    • MOODLE_403_STABLE, MOODLE_404_STABLE
    • 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.

      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)

            james-cnz James E. Calder
            james-cnz James E. Calder
            Laurent David Laurent David
            Shamim Rezaie Shamim Rezaie
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            3 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 5 hours, 1 minute
                5h 1m

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