Uploaded image for project: 'Moodle app'
  1. Moodle app
  2. MOBILE-2825

Error on resubmitting entry with files

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Test on any device and Moodle version.

      1. In Moodle, create a database with a file field and a required text field.
      2. In the app, go to the database and open the page to add a new entry.
      3. Upload a file in the file field.
      4. Leave the text field empty and try to save the entry.
      5. The message "You must supply a value here" will be displayed next to the text field.
      6. Enter some text in the text field and try to save the entry again.
      7. Check that no error is displayed and the entry is saved with the file.
      Show
      Test on any device and Moodle version. 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. Check that no error is displayed and the entry is saved with the file.
    • Affected Branches:
      MOODLE_36_STABLE
    • Fixed Branches:
      MOODLE_36_STABLE
    • Pull Master Branch:
    • Sprint:
      Moodle Mobile 3.6.1

      Description

      Steps to reproduce:

      1. In Moodle, create a database with a file field and a required text field.
      2. In the app, go to the database and open the page to add a new entry.
      3. Upload a file in the file field.
      4. Leave the text field empty and try to save the entry.
      5. The message "You must supply a value here" will be displayed next to the text field.
      6. Enter some text in the text field and try to save the entry again.
      7. 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:

      1. 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).
      2. Send the entry/post/etc. to Moodle.
      3. If the entry is sent successfully, delete the local files from the device.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                29/Mar/19