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

'Complete another course' isn't performing enough sanity checks, resulting in broken database records and an inability to view the completion report.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 3.7.3
    • Fix Version/s: None
    • Component/s: Course completion
    • Labels:
    • Affected Branches:
      MOODLE_37_STABLE

      Description

      When you set up completion criteria in a course, there's an option for 'Completion of other courses'.

      If you set up a Course A so that its completion is dependent on the completion of Course B, then subsequently delete Course B, the record is not deleted from mdl_course_completion_criteria. If you look in the database, you'll find a record with Course A in the course column, 8 in the criteriatype column, and Course B's ID in the courseinstance column.

      This makes it impossible to open the Course Completion Report - it fails with "Cannot find record in database table course".

      If you subsequently unlock the course completion criteria on Course A, leave the completion of other courses section empty, then save the criteria, it inserts another record into mdl_course_completion_criteria. This record has Course A's ID in the course column, 8 in the criteriatype column, and NULL in the courseinstance column.

      This results in two erroneous records for Course A in the table: one with a course ID for a course that no longer exists, and one with NULL for the course.

      As far as I can tell, there's no way to fix this from Moodle's UI. The only solution is to delete these records from the database manually. But doing this leaves course completion broken for the course, and using Moodle's UI to unlock the completion criteria for Course A, then save it without making changes, results in another (courseid, 8, NULL) record being inserted into mdl_course_completion_criteria.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              lexx_koto Alex Walker
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: