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

Better debugging information from create_course()

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6
    • Fix Version/s: 2.6
    • Component/s: Course
    • Labels:
    • Testing Instructions:
      Hide

      New exception handling

      Run the core_course_courselib_testcase unit test.

      Exception strings

      1. Create a course with some enroled users.
      2. Create a group with a given ID.
      3. Attempt to create another group with the same ID. Verify that the error reads "This ID number is already in use."
      4. Attempt to create a course with the same idnumber as existing, make sure the error message quotes the idnumber.
      5. Attempt to create a course with the same shortname as existing, make sure the error message quotes the shortname
      Show
      New exception handling Run the core_course_courselib_testcase unit test. Exception strings Create a course with some enroled users. Create a group with a given ID. Attempt to create another group with the same ID. Verify that the error reads "This ID number is already in use." Attempt to create a course with the same idnumber as existing, make sure the error message quotes the idnumber. Attempt to create a course with the same shortname as existing, make sure the error message quotes the shortname
    • Affected Branches:
      MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-41256-master

      Description

      The exception thrown on a duplicate shortname or idnumber in create_course() doesn't include the actual string, which would be helpful for debugging purposes. Compare how the same issue is handled in duplicate_course() in course/externallib.php.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  1 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    18/Nov/13