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

Course Completion deleted column (and notify table)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.5
    • Fix Version/s: 2.4
    • Component/s: Course completion
    • Labels:
    • Testing Instructions:
      Hide

      Two tests required:

      1)
      In a fresh install of a version with this patch applied - make sure course_completion_notify table is not created, and course_completions table does not include a deleted or timenotified field. course_completion_crit_compl should not include a deleted field either. Then follow steps at bottom of Testing Instructions.

      2)
      Install an earlier version of Moodle, then upgrade to a version with this patch applied. After upgrade - check the above is true.

      Second part of testing for both 1 & 2:

      Enable completion in advanced settings.
      Create new course, enable completion.
      Create completion criteria for course (enable self-completion).
      Add self completion block and course completion status block to course.
      Enrol at least one user.
      Run cron.
      Login as enrolled user, self complete course using block.
      Visit details page (via completion status block).
      Run cron.
      As admin view completion report for course.

      No errors should occur.

      Show
      Two tests required: 1) In a fresh install of a version with this patch applied - make sure course_completion_notify table is not created, and course_completions table does not include a deleted or timenotified field. course_completion_crit_compl should not include a deleted field either. Then follow steps at bottom of Testing Instructions. 2) Install an earlier version of Moodle, then upgrade to a version with this patch applied. After upgrade - check the above is true. Second part of testing for both 1 & 2: Enable completion in advanced settings. Create new course, enable completion. Create completion criteria for course (enable self-completion). Add self completion block and course completion status block to course. Enrol at least one user. Run cron. Login as enrolled user, self complete course using block. Visit details page (via completion status block). Run cron. As admin view completion report for course. No errors should occur.
    • Affected Branches:
      MOODLE_21_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE
    • Pull Master Branch:

      Description

      A number of bugs have arisen recently with course completion and some of these have highlighted issues with the 'deleted' column in several of the tables:

      • course_completion_crit_compl
      • course_completions

      These tables have deleted columns which were added in 2be4d090c0c0b5d09aa6140e9348fb65d20263d6 as part of MDL-2631.
      These fields are referenced in the class definition of:

      • completion_completion: 'Set to 1 if this record has been deleted'; and
      • completion_criteria_completion: 'Course deleted flag'.

      However they're never actually set anywhere.

      These class's fetch functions also appear to be add a check to only return rows where the deleted column is null.

      I propose that these columns are either:

      • removed and all references to them removed; or
      • utilised and the data_object delete() function overridden by those classes to update the column instead of delete the row.

      My gut says that we should be doing the latter to allow the potential for restoration of inadvertently deleted data but I'm not sure whether this is realistic in practice.

      I don't know enough about the requirements of this side of the code - perhaps someone from Catalyst as the original contributors of the code could shed some light?

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    3/Dec/12