File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
classes/local/form/elements Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -132,17 +132,22 @@ public function render_to(render_context $context): void {
132132 return ;
133133 }
134134
135- $ text = $ mydata ['text ' ];
135+ $ text =& $ mydata ['text ' ];
136136 $ format = $ mydata ['format ' ];
137137
138138 if (!$ this ->fileuploads ) {
139139 // Uploads are disabled.
140140 $ filemetas = [];
141141 } else {
142+ global $ USER ;
143+
144+ // When links are pasted from another editor, they still point to that editor's draft area.
145+ // File_merge_draft_areas copies the referenced files and rewrites the links.
146+ $ text = file_merge_draft_areas ($ draftitemid , context_user::instance ($ USER ->id )->id , $ text );
147+
142148 // Remove all draft files that aren't referenced in the markup.
143149 file_remove_editor_orphaned_files ($ mydata );
144150
145- global $ USER ;
146151 $ ofs = di::get (options_file_service::class);
147152 /** @var file_metadata[] $filemetas */
148153 $ filemetas = $ ofs ->get_qpy_files_metadata_from_draftitem ($ USER ->id , $ draftitemid );
You can’t perform that action at this time.
0 commit comments