-
Bug
-
Resolution: Done
-
Minor
-
3.6.0
-
-
MOODLE_36_STABLE
-
MOODLE_36_STABLE
-
Moodle Mobile 3.6.1
Steps to reproduce:
- In Moodle, create a database with a file field and a required text field.
- In the app, go to the database and open the page to add a new entry.
- Upload a file in the file field.
- Leave the text field empty and try to save the entry.
- The message "You must supply a value here" will be displayed next to the text field.
- Enter some text in the text field and try to save the entry again.
- Result: An error modal is displayed with message: "NOT_FOUND_ERR" and the entry is not saved.
This happens because the first time the entry is submitted files are uploaded to Moodle and deleted from the device.
This bug affects other pages in the app: it happens in the forum but it's more difficult to reproduce because the web service must return an error when sending a post.
We need to handle form submissions (and syncing of offline data) with files in a different way:
- First, upload files to Moodle to get a draft id but keep the temporary files in the device (but only if they are local files, if they are online files we can delete them because they will be downloaded again).
- Send the entry/post/etc. to Moodle.
- If the entry is sent successfully, delete the local files from the device.