course completion: MDL-2631 Fix rare mark_completed bug
authorAaron Barnes <aaronb@catalyst.net.nz>
Thu, 26 Aug 2010 23:08:58 +0000 (23:08 +0000)
committerAaron Barnes <aaronb@catalyst.net.nz>
Thu, 26 Aug 2010 23:08:58 +0000 (23:08 +0000)
lib/completion/completion_completion.php

index 2be4780..6737789 100644 (file)
@@ -232,6 +232,11 @@ class completion_completion extends data_object {
                 $this->reaggregate = 0;
             }
 
+                       // Make sure timestarted is not null
+                       if (!$this->timestarted) {
+                               $this->timestarted = 0;
+                       }
+                       
             $this->insert();
         }
     }