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

App should avoid downloading and re-uploading files when editing forum post and glossary entries

XMLWordPrintable

    • Hide

      This issue only needs to be tested in 1 device.

      Test edit forum with filters and embedded content

      Originally this wasn't part of this issue, but I found the bug when working on the issue and the new WS to treat attachments allowed me to fix it, so I did. I couldn't do the same for glossary though, I opened MOBILE-4647 to fix glossary later. 

      1. In a forum in browser, add a new discussion or post that includes filters (e.g. MathJax, emojis as text like :  ) without the space, etc.) and an embedded image. Please put filters only in the message of the post, not in the subject.
      2. In the app, login with the same user and edit the post (please notice you need to be online to do that). Check that the content displayed in the editor is "unfiltered" (e.g. you see the original MathJax text instead of the equation, or you see text instead of an emoji image). Also check that you can see the embedded image while editing.
      3. Change some text and save. Check that the content is displayed correctly: all filters are displayed as it should and you can still see the embedded image, both in the app and in browser.

      Test attachments

      1. Create a new forum discussion or post with attachments.
      2. Edit the post and check that the following works fine:
        1. Add new attachments.
        2. Remove attachments that were already in the post.
        3. Remove all attachments from the post.
      3. Test the same in glossary, editing a glossary entry to add/remove attachments.

      Bonus test: check that files aren't re-uploaded

      I already tested this when developing the issue, but we can do another check to confirm it works properly.

      This part should be tested by a developer. The easiest way to test this is in webapp.

      1. Repeat the "Test attachments" section, but inspecting the network requests. Check that attachments that were already in the post/entry aren't re-uploaded, only new attachments are uploaded using the upload.php endpoint. E.g. if you only remove attachments, no file should be uploaded.
      2. In case of glossary, you will see that the core_files_delete_draft_files WebService is called when removing attachments. In case of forum there's no need to because the prepare WS already lets we decide which files to keep, in forum the core_files_delete_draft_files is only used when we need to remove all online attachments. E.g. if you have 2 attachments and remove 1, the core_files_delete_draft_files won't be used in forum.
      Show
      This issue only needs to be tested in 1 device. Test edit forum with filters and embedded content Originally this wasn't part of this issue, but I found the bug when working on the issue and the new WS to treat attachments allowed me to fix it, so I did. I couldn't do the same for glossary though, I opened MOBILE-4647 to fix glossary later.  In a forum in browser, add a new discussion or post that includes filters (e.g. MathJax, emojis as text like :  ) without the space, etc.) and an embedded image. Please put filters only in the message of the post, not in the subject. In the app, login with the same user and edit the post (please notice you need to be online to do that). Check that the content displayed in the editor is "unfiltered" (e.g. you see the original MathJax text instead of the equation, or you see text instead of an emoji image). Also check that you can see the embedded image while editing. Change some text and save. Check that the content is displayed correctly: all filters are displayed as it should and you can still see the embedded image, both in the app and in browser. Test attachments Create a new forum discussion or post with attachments. Edit the post and check that the following works fine: Add new attachments. Remove attachments that were already in the post. Remove all attachments from the post. Test the same in glossary, editing a glossary entry to add/remove attachments. Bonus test: check that files aren't re-uploaded I already tested this when developing the issue, but we can do another check to confirm it works properly. This part should be tested by a developer. The easiest way to test this is in webapp. Repeat the "Test attachments" section, but inspecting the network requests. Check that attachments that were already in the post/entry aren't re-uploaded, only new attachments are uploaded using the upload.php endpoint. E.g. if you only remove attachments, no file should be uploaded. In case of glossary, you will see that the core_files_delete_draft_files WebService is called when removing attachments. In case of forum there's no need to because the prepare WS already lets we decide which files to keep, in forum the core_files_delete_draft_files is only used when we need to remove all online attachments. E.g. if you have 2 attachments and remove 1, the core_files_delete_draft_files won't be used in forum.
    • MOODLE_405_STABLE
    • Moodle Apps - 2024 i3.1, Moodle Apps - 2024 i3.2, Moodle Apps - 2024 i3.3

      In order to do so, there are a couple of Web Services that can be used to prepare a file area to be able to include and delete files from it (via Web Services, not having to download in advance the files)

      • mod_glossary_prepare_entry_for_edition
      • mod_forum_prepare_draft_area_for_post

        1. MOBILE-4482_step2_notAsExpected.png
          160 kB
          Isabel Renedo Rouco
        2. MOBILE-4482_step3_notAsExpected_MathJax.png
          359 kB
          Isabel Renedo Rouco
        3. MOBILE-4482_TestAttachments_doublecheck.png
          206 kB
          Isabel Renedo Rouco
        4. MOBILE-4482_testEditForum_editedPostWrongRatio.png
          576 kB
          Isabel Renedo Rouco
        5. MOBILE-4482_testEditForum_saved.png
          484 kB
          Isabel Renedo Rouco

            dpalou Dani Palou
            jleyva Juan Leyva
            Pau Ferrer Pau Ferrer
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 23 minutes
                1h 23m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.