Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-4559

LMB should handle course conflicts more gracefully

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4.5
    • Fix Version/s: 2.5.1
    • Component/s: Enrol: Banner/LMB
    • Labels:
      None
    • Plugin Version:
      2.5.0
    • Affected Branches:
      MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE

      Description

      The following sequence of events happened to us last week:

      1. LMB creates course for the current term.
      2. Teacher imports course data from past term.
      3. Teacher ticks box that says 'overwrite course configuration' (we think)
      4. Course idnumber gets annihilated somehow

      The next day LMB (we run in bulk mode) tried to re-create the now missing course, but encountered a fatal error since the shortname still existed. Stack trace:

      Default exception handler: Short name is already used for another course Debug:
      Error code: shortnametaken

      • line 3837 of /course/lib.php: moodle_exception thrown
      • line 778 of /enrol/lmb/lib.php: call to create_course()
      • line 635 of /enrol/lmb/lib.php: call to enrol_lmb_plugin->create_shell_course()
      • line 465 of /enrol/lmb/lib.php: call to enrol_lmb_plugin->process_course_section_tag()
      • line 277 of /enrol/lmb/lib.php: call to enrol_lmb_plugin->process_group_tag()
      • line 385 of /enrol/lmb/lib.php: call to enrol_lmb_plugin->process_file()
      • line 72 of /enrol/lmb/cli/folderprocess.php: call to enrol_lmb_plugin->process_folder()

      !!! Short name is already used for another course !!!

      LMB stopped on this exception, preventing it from running until we'd tracked down the bad course. This proved difficult since create_course() doesn't include the bad shortname or idnumber in the exception. I've raised that issue in MDL-41256. What I'm wondering is if LMB can perhaps catch these exceptions and log them, so that one bad course doesn't stop the whole process.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  8/Jul/13