Best practice forum (Archived)

Query about emergency Release of 2.4.19.1, 2.5.12.1 and 2.6.0.1

 
Daniel Bond
Query about emergency Release of 2.4.19.1, 2.5.12.1 and 2.6.0.1
by Daniel Bond - Wednesday, 7 May 2014, 1:25 AM
Group Most helpful contributor 2023

Hi,

Since the above emergency release is a critical one, and involves possible data loss across versions which have been "in the wild" for quite some time, is there any fix included or in development to "regenerate" the data? I'm a little unclear if the activity completion data is affected or not, and therefore whether the course completion data could be recreated from those records.

Regards

Dan

Simon Coggins
Re: Query about emergency Release of 2.4.19.1, 2.5.12.1 and 2.6.0.1
by Simon Coggins - Wednesday, 7 May 2014, 2:45 AM
Group Totara

Hi Dan,

We wanted to get a fix out as a first priority - but we still have a bit more work to do to understand exactly which data is affected and if the data can be recalculated.

Below is my current understanding but I'll follow up tomorrow to confirm the exact details. I'm also going to see if the log table provides a way to confirm if a site was affected or not.

The problem is running the function delete_course_completion_data() deletes data from the 'course_completion_crit_compl' table for ALL courses instead of just the one you wanted to clear.
 
course_completion_crit_compl contains the records of individual criteria completion so:
 
* If the individual criteria is an activity, and there is a record in course_module_completions the record will most likely be regenerated on the next cron run
* Date based criteria should also be recalculated
* Manual self completion is not stored anywhere else so won't be regenerated
* Most likely role based self completion won't be regenerated either
* Activity completion data is not affected
* Overall course completion records are NOT affected (so if a user has already completed a course it will still show as complete), but the details of which criteria they met might be affected
 
Once the data's gone, unfortunately there is no way to recover it without backups. If you have database backups it might be possible to reconstruct but it is unlikely to be straightforward. If anyone has suffered data loss due to this bug please open a support ticket and we will do what we can to help.
 
Simon
 
 
Simon Coggins
Re: Query about emergency Release of 2.4.19.1, 2.5.12.1 and 2.6.0.1
by Simon Coggins - Wednesday, 7 May 2014, 8:42 PM
Group Totara

Here is some additional information on the effects of this issue:

To determine if your site has been affected.

Your site is affected if you meet ALL three criteria below:

1. Your site was live with any of the following versions:

2.4.18
2.4.19
2.5.10
2.5.11
2.5.12
2.6.0

Note: These versions were all released on or after 15th April 2014 11th March 2014 so if you haven't upgraded since then you will be unaffected.


2. You make use of the "Course completion" feature.


3. Any of the following actions were performed while you were running one of the affected version (e.g. since upgrading):

Action Log record
Edited the course completion settings on any course in your site, unless you just pressed "Unlock criteria without deleting". 'course completion updated' (unless immediately preceeded by 'course completion unlocked without reset').
Clicking "Unlock criteria and delete existing completion data" button on any course completion settings page. 'course completion data reset'
Deleted any course in your site. 'course delete'
Deleted a category on your site, if the category contained courses and you chose the "delete all contents" option. 'category delete'. No way to tell if it contained courses or if 'delete all contents' was chosen.
Reset any course in your site with the "delete completion data" option checked. None
Restore a course into current or another existing course with "delete the contents of the existing course and then restore" option selected None

The log records column indicates if this action is recorded in the site logs. You should be able to search your recent logs and look for the 'action' mentioned to see if each event occurred.


What will be lost if you are affected:

The data that is lost indicates which individual course completion criteria have been met. The bug does not affect the overall course completion data so if users have already completed a course that will still be shown. However if they are part way through a course their progress may have gone, and if they have completed a course the course completion report won't show which criteria they met.


To recover lost data if you are affected:

Some criteria can be regenerated based off other data within the site. This is dependent on the course completion criteria type you are using:

The following criteria will automatically be regenerated the next time your site's cron is run:

  • Date
  • Days left (duration)

The following criteria is recoverable, and we will provide an upgrade script in the next release of 2.4 and 2.5 to recalculate this data when you upgrade:

  • Activity completion (all activities)
  • Completion of other courses
  • Course Grade

The following criteria are unfortunately not recoverable without database backups:

  • Manual self completion
  • Manual completion by others

 

Simon