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

Course deletion failed on question bank purging

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 1.9.11, 2.0
    • Component/s: Questions
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE

      Description

      Deleting a course with the question in it I get an error message:

      Debug info: Unknown column 'course' in 'where clause'
      SELECT 'x' FROM mdl_question_categories WHERE course IS NULL AND id = ? LIMIT 0, 1
      [array (
      0 => '15',
      )]
      Stack trace:
      line 391 of \lib\dml\moodle_database.php: dml_read_exception thrown
      line 691 of \lib\dml\mysqli_native_moodle_database.php: call to moodle_database->query_end()
      line 1540 of \lib\dml\moodle_database.php: call to mysqli_native_moodle_database->get_recordset_sql()
      line 1525 of \lib\dml\moodle_database.php: call to moodle_database->record_exists_sql()
      line 1509 of \lib\dml\moodle_database.php: call to moodle_database->record_exists_select()
      line 2269 of \lib\questionlib.php: call to moodle_database->record_exists()
      line 654 of \lib\questionlib.php: call to sort_categories_by_tree()
      line 4186 of \lib\moodlelib.php: call to question_delete_course()
      line 4048 of \lib\moodlelib.php: call to remove_course_contents()
      line 69 of \course\delete.php: call to delete_course()

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            mkassaei Mahmoud Kassaei added a comment -

            changes in and call to sort_categories_by_tree() function in questionlib.php passing and using contextid

            Show
            mkassaei Mahmoud Kassaei added a comment - changes in and call to sort_categories_by_tree() function in questionlib.php passing and using contextid
            Hide
            timhunt Tim Hunt added a comment -

            I just realised that this affects Moodle 1.9 too, so I backported the fix.

            Thanks for fixing this Mahmoud.

            Show
            timhunt Tim Hunt added a comment - I just realised that this affects Moodle 1.9 too, so I backported the fix. Thanks for fixing this Mahmoud.

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  24/Nov/10