-
Bug
-
Resolution: Fixed
-
Critical
-
2.5.3, 2.6.2, 2.7.2, 3.2.1
-
MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_32_STABLE
-
MOODLE_32_STABLE, MOODLE_33_STABLE
-
MDL-44961-master -
-
3.4 Sprint 1
We believe have found a big log / stats issue and have confirmed another school has the same problem.. which could make the stats/log report no longer correct or inaccurate.
My colleague inquired about this...
https://moodle.org/mod/forum/discuss.php?d=255513#p1115613
I've recently noticed that our mdl_log file contains dates all the way into the year 2018! After investigating this for hours, I've discovered that this is caused when a course is restored WITH the activity log and the course start date is rolled forward. If the new start date is 173 days later that it was in the course being restored, then all of the dates in the logs are updated to be 173 days later – even if that date hasn't yet occurred. The log file now contains double the records and the new ones are completely false, but will still affect the statistics when they are reported.
I realize that it is a user error to restore course logs when restoring it to create a copy for the future. However, I don't understand why the roll would even touch those records. Logs are sacred. You'd think there would be some way to ensure there are no future dates in a log file!
The other problem is that when a course is deleted, so are the log records! This is terrible when you're running statistics! I just don't understand why these records are being manipulated this way. Am I looking at the wrong table? Is there another one that I should be looking at?
I feel like I must be missing something important.
=========================
From the other school ...
=========================
This is exactly what I am seeing.
I just did a test which gave me the same results. Created a course, TestDates_2014CRS, added a couple of users, had them do a couple of transactions, backed it up with users, logs and history, then restored it with all user data and logs and a start date 1 year after the original start date.
When I first looked at the course logs, the dates were correct, but when I looked at the participant logs, they were out by a year, then when I went back to the course logs, those were also out by a year.
Thank you for finding this Lawrence; is there anything we can do to correct this now we know what the problem is?
---------------------------------------------------------------------------
From the similar issue MDL-47743 that was closed as a duplicate of this:
Courses backed up in 2.5.4+ are restored into 2.6.5+. Student activty logs of restored course are not viable (activity dates default to the day of the restore), ip address, action, information fields are blank or gibberish.
This was fixed in MDL-48644
Also please see discussion on MDL-9367 (deferred in favour of this issue)
- has a non-specific relationship to
-
MDL-9367 Restore with roll forward changes dates for user data
- Closed
- has been marked as being related by
-
MDL-47743 Student Activity Report Logs of 2.6.5+ not restored from a 2.5.4+ course backup
- Closed
-
MDL-20756 Wrong dates in forums after backup and restore
- Closed
- will help resolve
-
MDL-48644 Restore of legacy logs loses the original log time and IP
- Closed