Fixed registering new form definition
authorDavid Mudrak <david@moodle.com>
Tue, 18 Oct 2011 14:27:22 +0000 (16:27 +0200)
committerDavid Mudrak <david@moodle.com>
Tue, 18 Oct 2011 14:27:22 +0000 (16:27 +0200)
grade/grading/form/lib.php

index d6c4e59..59bbc36 100644 (file)
@@ -245,11 +245,11 @@ abstract class gradingform_controller {
             $record->method       = $this->get_method_name();
             $record->timecreated  = time();
             $record->usercreated  = $usermodified;
-            $record->timemodified = $definition->timecreated;
-            $record->usermodified = $definition->usercreated;
+            $record->timemodified = $record->timecreated;
+            $record->usermodified = $record->usercreated;
             $record->status       = self::DEFINITION_STATUS_WORKINPROGRESS;
 
-            $DB->insert_record('grading_definitions', $definition);
+            $DB->insert_record('grading_definitions', $record);
 
         } else {
             throw new coding_exception('Unknown status of the cached definition record.');