Moodle
  1. Moodle
  2. MDL-36130

mod_assign: log entries are lost when migrating from 2.2 assignments

    Details

    • Testing Instructions:
      Hide
      1. Create an instance of "Assignment 2.2" (online text)
      2. Login as a student and make a submission (to generate some logs)
      3. Login as a teacher and view the "Live logs" for the course to see that there are some logs for the assignment
      4. Login as a site administrator and upgrade the assignment using the Assignment Upgrade Tool
      5. Go back to the course and view the "Live logs" again
      6. Verify that there are still logs for the assignment from before the upgrade.
      Show
      Create an instance of "Assignment 2.2" (online text) Login as a student and make a submission (to generate some logs) Login as a teacher and view the "Live logs" for the course to see that there are some logs for the assignment Login as a site administrator and upgrade the assignment using the Assignment Upgrade Tool Go back to the course and view the "Live logs" again Verify that there are still logs for the assignment from before the upgrade.
    • Workaround:
      Hide

      Restore from a course backup and view the logs in the old assignment.

      Show
      Restore from a course backup and view the logs in the old assignment.
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
    • Rank:
      44901

      Description

      When upgrading an an assignment from mod_assignment to mod_assign, all log entries related to the original module are lost.

        Activity

        Hide
        Michael de Raadt added a comment -

        Thanks for working on that.

        Show
        Michael de Raadt added a comment - Thanks for working on that.
        Hide
        Damyon Wiese added a comment -

        Hi Adam,

        This code also needs to change the module column from assignment to assign (as well as the cmid).

        In general this is a double edged sword - on one hand people want to be able to view the old logs, on the other hand - the urls and actions from the old module do not apply to the new one - so the data is kind of broken. At least this stops it from being deleted.

        Show
        Damyon Wiese added a comment - Hi Adam, This code also needs to change the module column from assignment to assign (as well as the cmid). In general this is a double edged sword - on one hand people want to be able to view the old logs, on the other hand - the urls and actions from the old module do not apply to the new one - so the data is kind of broken. At least this stops it from being deleted.
        Hide
        Adam Olley added a comment -

        Hi Damyon,

        Thanks for catching that, I've updated my branches accordingly.

        Show
        Adam Olley added a comment - Hi Damyon, Thanks for catching that, I've updated my branches accordingly.
        Hide
        Damyon Wiese added a comment -

        Thanks Adam

        This looks fine now. I added testing instructions (and tested it) and put in your repository URL.

        Damyon

        Show
        Damyon Wiese added a comment - Thanks Adam This looks fine now. I added testing instructions (and tested it) and put in your repository URL. Damyon
        Hide
        Aparup Banerjee added a comment -

        Hi Guys,
        i've tested this and the database is updated fine.

        What is weird though is i'm still seeing the old cmid in live logs links or logs even after purging caches. this ofcourse results in those click throughs ending in errors.

        Show
        Aparup Banerjee added a comment - Hi Guys, i've tested this and the database is updated fine. What is weird though is i'm still seeing the old cmid in live logs links or logs even after purging caches. this ofcourse results in those click throughs ending in errors.
        Hide
        Damyon Wiese added a comment -

        Hi Aparup,

        Yes - that's what I meant "by kind of broken" - the choice is whether to delete the urls for the old log entries or not (It is not possible to convert them all - the new assignment has different pages and accepts different parameters). I thought it was better not to delete them as they might have a use for auditing etc.

        • Damyon
        Show
        Damyon Wiese added a comment - Hi Aparup, Yes - that's what I meant "by kind of broken" - the choice is whether to delete the urls for the old log entries or not (It is not possible to convert them all - the new assignment has different pages and accepts different parameters). I thought it was better not to delete them as they might have a use for auditing etc. Damyon
        Hide
        Aparup Banerjee added a comment -

        ah thanks for clearing that up

        thats been tested & integrated into 23 and master.

        ps : i suppose ideally that broken link would explain the upgrade issue - but ideally we'd have a lot of time and this is somewhat a transitional thing.

        Show
        Aparup Banerjee added a comment - ah thanks for clearing that up thats been tested & integrated into 23 and master. ps : i suppose ideally that broken link would explain the upgrade issue - but ideally we'd have a lot of time and this is somewhat a transitional thing.
        Hide
        Aparup Banerjee added a comment -

        tested and passed

        Show
        Aparup Banerjee added a comment - tested and passed
        Hide
        Dan Poltawski added a comment -

        Hurray!

        You did it, congratulations! You have on Mojito credit to redeem after the release of Moodle 2.4

        Show
        Dan Poltawski added a comment - Hurray! You did it, congratulations! You have on Mojito credit to redeem after the release of Moodle 2.4

          People

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

            Dates

            • Created:
              Updated:
              Resolved: