Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
3.7.9
-
None
-
None
Description
Since MDL-62037, when multiple files with the same filename are uploaded a 'time' parameter is added to the download link. Since MDL-45170 (added in 3.6), when text containing a draftfile.php link is copied to another context, the files are parsed and duplicated into the new context. Any links with the time parameter fail to parse correctly causing a 'file not found' error to be displayed.
Steps to replicate:
- Add new content to course (e.g. label)
- Insert the multiple images using the file picker (select overwrite on subsequent upload)
- Select and copy content from the editor
- Save and return to course
- Add another content item (e.g. label)
- Paste copied content
- Save and return to course
- 'File does not exist' error is displayed
A potential fix included in the referenced patch is to update the filename regex in the extract_draft_file_urls_from_text function so parameters are excluded (by way of excluding '?' character from valid filename chars).