MDL-62755 mod_assign: Fix override export problem.
authorAdrian Greeve <adrian@moodle.com>
Wed, 20 Jun 2018 05:20:22 +0000 (13:20 +0800)
committerAdrian Greeve <adrian@moodle.com>
Mon, 25 Jun 2018 01:49:13 +0000 (09:49 +0800)
The cutoffdate and allowsubmissionsfromdate were not
being exported.

mod/assign/classes/privacy/provider.php

index 7f7841d..8150d63 100644 (file)
@@ -141,8 +141,6 @@ class provider implements metadataprovider, pluginprovider, preference_provider
                   JOIN {context} ctx ON cm.id = ctx.instanceid AND ctx.contextlevel = :contextlevel
                   JOIN {assign_grades} ag ON a.id = ag.assignment AND (ag.userid = :userid OR ag.grader = :graderid)";
 
-                  global $DB;
-
         $contextlist = new contextlist();
         $contextlist->add_from_sql($sql, $params);
 
@@ -475,10 +473,10 @@ class provider implements metadataprovider, pluginprovider, preference_provider
                 $data->duedate = transform::datetime($overrides->duedate);
             }
             if (!empty($overrides->cutoffdate)) {
-                $overrides->cutoffdate = transform::datetime($overrides->cutoffdate);
+                $data->cutoffdate = transform::datetime($overrides->cutoffdate);
             }
             if (!empty($overrides->allowsubmissionsfromdate)) {
-                $overrides->allowsubmissionsfromdate = transform::datetime($overrides->allowsubmissionsfromdate);
+                $data->allowsubmissionsfromdate = transform::datetime($overrides->allowsubmissionsfromdate);
             }
             if (!empty($data)) {
                 writer::with_context($context)->export_data([get_string('overrides', 'mod_assign')], $data);