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

Modules are not correctly added to sections

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.3.6
    • Fix Version/s: None
    • Component/s: Course
    • Labels:
      None
    • Affected Branches:
      MOODLE_23_STABLE

      Description

      The function add_mod_to_section in the course/lib.php library does not correctly locate the course section where the course module is to be added.

      The code uses the following query to find the section:

      {$DB->get_record("course_sections", array("course"=>$mod->course, "section"=>$mod->section))}

      It should be changed to:

      {$DB->get_record("course_sections", array("course"=>$mod->course, "id"=>$mod->section))}

      The $mod->section field should refer to the course_sections.id and not to the course_sections.section field

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              poltawski Dan Poltawski
              Reporter:
              pcharsle Paul Charsley
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: