Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-69729

Clean up temporary H5P editor files (backport of MDL-68909)

XMLWordPrintable

    • MOODLE_39_STABLE
    • MOODLE_39_STABLE
    • Hide

      Requirements

      1. Access to DB (to run some SQL queries).

      Setup. IMPORTANT: It should be run before applying the patch!!

      1. Login as admin.
      2. Access to the Content bank.
      3. Upload the attached file.
      4. Access to the main page of the Content bank
      5. Add a new "Greeting card" content.
      6. Fill in all the form fields. In the "Card image" section, upload an image.
      7. Save the content.
      8. Check the greeting card is displayed and contains the uploaded image.
      9. Check the result of the following SQL query is higher than 0: 

        SELECT count(*)
        FROM mdl_files
        WHERE component='core_h5p' AND filearea='editor'

      10. Apply this patch to the branch (or checkout the branch to the latest integration commit).

      Testing scenario 1: Upgrade process removes unused 'editor' files

      1.  Login as admin.
      2. Run the upgrade process.
      3. Check the upgrade process finishes without errors.
      4. Check the result of the following SQL query is 0: 

        SELECT count(*)
        FROM mdl_files
        WHERE component='core_h5p' AND filearea='editor'

      Testing scenario 2: Edit H5P content with images

      1. Access to the "greeting-card.h5p" H5P content in the content bank.
      2. Click the "Edit" button.
      3. Check the "Card image" is displayed (is should show the Earth).
      4. Remove this image and upload a new one.
      5. Check the new image is displayed properly in the "Card image" section.
      6. Save.
      7. Check now the greeting card contains the uploaded image (instead of the Earth).
      8. Click the "Edit" button again.
      9. Check the "Card image" is displayed (it should show the new image uploaded).
      10. Check the result of the following SQL query is 0: 

        SELECT count(*)
        FROM mdl_files
        WHERE component='core_h5p' AND filearea='editor'

       

      Testing scenario 3: Create new H5P content with images

      1. Access to the content bank
      2. Add a new "Greeting card" content.
      3. Fill in all the form fields.
      4. In the "Card image" section, upload an image.
      5. Check the new image is displayed properly in the "Card image" section.
      6. Save the content.
      7. Check the greeting card contains the uploaded image.
      8. Click the "Edit" button.
      9. Check the "Card image" is displayed as expected.
      10. Check the result of the following SQL query is still 0: 

        SELECT count(*)
        FROM mdl_files
        WHERE component='core_h5p' AND filearea='editor'

      Show
      Requirements Access to DB (to run some SQL queries). Setup. IMPORTANT: It should be run before applying the patch!! Login as admin. Access to the Content bank. Upload the attached file. Access to the main page of the Content bank Add a new "Greeting card" content. Fill in all the form fields. In the "Card image" section, upload an image. Save the content. Check the greeting card is displayed and contains the uploaded image. Check the result of the following SQL query is higher than 0:  SELECT count(*) FROM mdl_files WHERE component='core_h5p' AND filearea='editor' Apply this patch to the branch (or checkout the branch to the latest integration commit). Testing scenario 1: Upgrade process removes unused 'editor' files  Login as admin. Run the upgrade process. Check the upgrade process finishes without errors. Check the result of the following SQL query is 0:  SELECT count(*) FROM mdl_files WHERE component='core_h5p' AND filearea='editor' Testing scenario 2: Edit H5P content with images Access to the "greeting-card.h5p" H5P content in the content bank. Click the "Edit" button. Check the "Card image" is displayed (is should show the Earth). Remove this image and upload a new one. Check the new image is displayed properly in the "Card image" section. Save. Check  now the greeting card contains the uploaded image (instead of the Earth). Click the "Edit" button again. Check the "Card image" is displayed (it should show the new image uploaded). Check the result of the following SQL query is 0:  SELECT count(*) FROM mdl_files WHERE component='core_h5p' AND filearea='editor'   Testing scenario 3: Create new H5P content with images Access to the content bank Add a new "Greeting card" content. Fill in all the form fields. In the "Card image" section, upload an image. Check the new image is displayed properly in the "Card image" section. Save the content. Check the greeting card contains the uploaded image. Click the "Edit" button. Check the "Card image" is displayed as expected. Check the result of the following SQL query is still 0:  SELECT count(*) FROM mdl_files WHERE component='core_h5p' AND filearea='editor'
    • Moppies Kanban

      MDL-68909 is an improvement to avoid having unused entries in files DB for the temporary H5P editor files. This issue moves temporary files from the component='core_h5p', filearea='editor' and system context to the user draft filearea.

      In Moodle 3.9, some patch should be applied too to remove these unused entries in the files table and I think the best way to proceed is to request for a backport (the patch doesn't change the API and seems safe). The alternative to backporting is to implement an specific solution for Moodle 3.9 (maybe some task to remove them periodically, which will used only by Moodle 3.9).

        1. MDL-69729 (2).jpg
          MDL-69729 (2).jpg
          64 kB
        2. MDL-69729.jpg
          MDL-69729.jpg
          48 kB
        3. greeting-card.h5p
          35 kB

            sarjona Sara Arjona (@sarjona)
            sarjona Sara Arjona (@sarjona)
            Carlos Escobedo Carlos Escobedo
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Anna Carissa Sadia Anna Carissa Sadia
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 5 hours
                5h

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