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

Duplicating activities causes duplicate rows in course_completion_aggr_methd when course completion enabled

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Duplicate
    • Affects Version/s: 2.1.4, 2.2.1, 2.3
    • Fix Version/s: None
    • Component/s: Backup, Course completion
    • Labels:
      None
    • Testing Instructions:
      Hide

      Replication Instructions

      • Select Settings -> Site Administration -> Advanced
      • Enable 'Completion Tracking'
      • Create a new course
        • Under 'Student Progress', change 'Completion Tracking' to Enabled
      • Select Settings -> Course Administration -> Completion Tracking
      • Save the Settings (this step actually seems to create the initial values in course_completion_aggr_methd)
      • Create a new Lesson with default settings
      • Confirm that you can still access Select Settings -> Course Administration -> Completion Tracking
      • Return to the course
      • Select the duplicate button against the Lesson and confirm
      • Confirm that you can no longer access Select Settings -> Course Administration -> Completion Tracking
      Show
      Replication Instructions Select Settings -> Site Administration -> Advanced Enable 'Completion Tracking' Create a new course Under 'Student Progress', change 'Completion Tracking' to Enabled Select Settings -> Course Administration -> Completion Tracking Save the Settings (this step actually seems to create the initial values in course_completion_aggr_methd) Create a new Lesson with default settings Confirm that you can still access Select Settings -> Course Administration -> Completion Tracking Return to the course Select the duplicate button against the Lesson and confirm Confirm that you can no longer access Select Settings -> Course Administration -> Completion Tracking
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-30825-master-1

      Description

      When duplicating an activity with Course Completion is enabled the records in the course_completion_aggr_methd table are duplicated

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              dobedobedoh Andrew Nicols added a comment -

              I don't believe that this bug affects MOODLE_20_STABLE as it's not possible to duplicate activities in 2.0

              I've tested this on each of the branches I've filed pull requests for and have tested with a snapshot of our live data on MOODLE_22_STABLE

              Show
              dobedobedoh Andrew Nicols added a comment - I don't believe that this bug affects MOODLE_20_STABLE as it's not possible to duplicate activities in 2.0 I've tested this on each of the branches I've filed pull requests for and have tested with a snapshot of our live data on MOODLE_22_STABLE
              Hide
              dobedobedoh Andrew Nicols added a comment - - edited

              I'm raising the severity of this issue to Critical because it breaks Course Completion functionality and causes data corruption

              Show
              dobedobedoh Andrew Nicols added a comment - - edited I'm raising the severity of this issue to Critical because it breaks Course Completion functionality and causes data corruption
              Hide
              poltawski Dan Poltawski added a comment -

              Adding Sam M here..

              Show
              poltawski Dan Poltawski added a comment - Adding Sam M here..
              Hide
              dobedobedoh Andrew Nicols added a comment -

              MDL-29350 is a similar issue relating to duplication of activities. I suspect that there may be others out there too.

              Show
              dobedobedoh Andrew Nicols added a comment - MDL-29350 is a similar issue relating to duplication of activities. I suspect that there may be others out there too.
              Hide
              quen Sam Marshall added a comment -

              dan - sorry but course completion is officially not my problem! (I didn't write the code and don't maintain it; we also don't use that feature here at present.)

              I did activity completion, which is the table course_modules_completion among other things. Totally not the same thing as course completion, which is of course immediately evident from the table n... oh.

              Show
              quen Sam Marshall added a comment - dan - sorry but course completion is officially not my problem! (I didn't write the code and don't maintain it; we also don't use that feature here at present.) I did activity completion, which is the table course_modules_completion among other things. Totally not the same thing as course completion, which is of course immediately evident from the table n... oh.
              Hide
              quen Sam Marshall added a comment -

              that said, the code changes looks ok, but I don't really know

              Show
              quen Sam Marshall added a comment - that said, the code changes looks ok, but I don't really know
              Hide
              poltawski Dan Poltawski added a comment -

              Sorry - I realised right after I wrote it. Constantly getting them mixed up..

              Show
              poltawski Dan Poltawski added a comment - Sorry - I realised right after I wrote it. Constantly getting them mixed up..
              Hide
              dobedobedoh Andrew Nicols added a comment -

              Adding Jonathan Newman as a watcher as he seems to have originally been involved in it's inclusion

              Show
              dobedobedoh Andrew Nicols added a comment - Adding Jonathan Newman as a watcher as he seems to have originally been involved in it's inclusion
              Hide
              dobedobedoh Andrew Nicols added a comment -

              I'm adding Eloy as a watcher because he had some specific comments on the DB upgrade for the related issue (MDL-29350)

              Show
              dobedobedoh Andrew Nicols added a comment - I'm adding Eloy as a watcher because he had some specific comments on the DB upgrade for the related issue ( MDL-29350 )
              Hide
              dobedobedoh Andrew Nicols added a comment -

              Just wanted to clarify - the update only groups on course, criteriatype, and method. It does not group on the value – from what I can tell each combination of course, criteriatype, and method should only have one value and not multiples.

              Show
              dobedobedoh Andrew Nicols added a comment - Just wanted to clarify - the update only groups on course, criteriatype, and method. It does not group on the value – from what I can tell each combination of course, criteriatype, and method should only have one value and not multiples.
              Hide
              salvetore Michael de Raadt added a comment -

              Hi, Andrew.

              I'm wondering if you took the changes made by Eloy in MDL-28180 into account with this change, or of this issue follows on from that issue?

              Show
              salvetore Michael de Raadt added a comment - Hi, Andrew. I'm wondering if you took the changes made by Eloy in MDL-28180 into account with this change, or of this issue follows on from that issue?
              Hide
              dobedobedoh Andrew Nicols added a comment -

              Looks like it's the same bug, and the patch is almost identical too.

              Show
              dobedobedoh Andrew Nicols added a comment - Looks like it's the same bug, and the patch is almost identical too.
              Hide
              dobedobedoh Andrew Nicols added a comment -

              Linking these two bugs as duplicates - thanks Michael

              Show
              dobedobedoh Andrew Nicols added a comment - Linking these two bugs as duplicates - thanks Michael
              Hide
              poltawski Dan Poltawski added a comment -

              Note for any watchers that Eloys fix is more accurate because it only tests for duplicte on course and critieriatype

              Show
              poltawski Dan Poltawski added a comment - Note for any watchers that Eloys fix is more accurate because it only tests for duplicte on course and critieriatype

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved: