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

course_add_cm_to_section should not test for sections unless necessary

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6
    • Fix Version/s: 2.4.6, 2.5.2
    • Component/s: Course
    • Labels:
    • Testing Instructions:
      Hide
      1. Create course
      2. Add activity
      3. Move activity to another section
      4. Refresh page, make sure everything is ok
      5. Disable AJAX (or Javascript) and move activity to another section again
      6. Make sure everything looks ok
      Show
      Create course Add activity Move activity to another section Refresh page, make sure everything is ok Disable AJAX (or Javascript) and move activity to another section again Make sure everything looks ok
    • Affected Branches:
      MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE
    • Pull Master Branch:
      MDL-41045-master

      Description

      The course_add_cm_to_section has a comment about not using modinfo because it might not be valid. (It clears modinfo, but does not use it directly.) However, it calls course_create_sections_if_missing which does use modinfo.

      This causes performance problems if you try to add a cm to a section repeatedly, which I am doing at present; each time it will create modinfo, then clear it. Additionally, presumably there was some reason for not using modinfo in the first place.

      I propose that we change course_create_sections_if_missing so that it optionally doesn't use modinfo.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                quen Sam Marshall
                Reporter:
                quen Sam Marshall
                Peer reviewer:
                Marina Glancy
                Integrator:
                Sam Hemelryk
                Tester:
                Michael de Raadt
                Participants:
                Component watchers:
                Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  9/Sep/13