-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
3.10.7
If you use drag-and-drop upload to a course that multiple people are editing, this can have unexpected results because it uses section number (not id) to identify the place you are uploading to.
To reproduce:
- Create a new course with Topics format
- Go to the course and turn editing on.
- Add a label in topic 2 with text 'This topic has an important file'.
- Add a label in topic 3 with text 'This topic does not have a file'.
- Open a second tab on the same course.
- In the second tab, delete topic 1.
- In the first tab, drag and drop a text file (something.txt) from your computer into topic 2.
- Observe that the file has appeared correctly in topic 2 before the label that says there is a file in that topic.
- Reload the page
- Now the file is showing in the topic that supposedly doesn't have a file.
This is a made-up example; the problem is worse when sections are configured to appear on different pages. In that case, when you reload the page your file that you just added disappears entirely.
We also had cases where the course got somehow broken as a result of this - a cmid that isn't in any section at all, for instance - which could be this problem, or could be because the logic about drag and drop upload doesn't use database transactions which it should do. So I'll add a transaction as well when I change it.
There are of course lots of ways that something similar could break the page when two people are editing a course at once (for example, somebody could delete the same topic you are actually editing) but this one is easily avoidable - all that is needed is to use the section id instead of the section number, and the topic being uploaded to will stay consistent.
- is child of
-
MDL-78628 Drag and drop upload of text/links: Experimental - Review and decide
-
- Open
-