MDL-62491 mod_assign: Fill in the rewrite plugin urls properly.
authorAdrian Greeve <abgreeve@gmail.com>
Fri, 14 Sep 2018 02:22:40 +0000 (10:22 +0800)
committerAdrian Greeve <abgreeve@gmail.com>
Mon, 8 Oct 2018 01:00:08 +0000 (09:00 +0800)
mod/assign/submission/onlinetext/classes/privacy/provider.php

index 27a7d56..fc5e274 100644 (file)
@@ -98,9 +98,10 @@ class provider implements metadataprovider, \mod_assign\privacy\assignsubmission
         $context = $exportdata->get_context();
         if (!empty($editortext)) {
             $submissiontext = new \stdClass();
         $context = $exportdata->get_context();
         if (!empty($editortext)) {
             $submissiontext = new \stdClass();
-            $submissiontext->text = writer::with_context($context)->rewrite_pluginfile_urls([], '', '', '', $editortext);
             $currentpath = $exportdata->get_subcontext();
             $currentpath[] = get_string('privacy:path', 'assignsubmission_onlinetext');
             $currentpath = $exportdata->get_subcontext();
             $currentpath[] = get_string('privacy:path', 'assignsubmission_onlinetext');
+            $submissiontext->text = writer::with_context($context)->rewrite_pluginfile_urls($currentpath,
+                    'assignsubmission_onlinetext', 'submissions_onlinetext', $submission->id, $editortext);
             writer::with_context($context)
                     ->export_area_files($currentpath, 'assignsubmission_onlinetext', 'submissions_onlinetext', $submission->id)
                     // Add the text to the exporter.
             writer::with_context($context)
                     ->export_area_files($currentpath, 'assignsubmission_onlinetext', 'submissions_onlinetext', $submission->id)
                     // Add the text to the exporter.