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

Delete cache assets when removing libraries

    XMLWordPrintable

Details

    • MOODLE_38_STABLE
    • MOODLE_38_STABLE
    • Hide

      Setup

      1. Moodle Site with one course named course1.
      2. Acces as admin in the Moodle Site.
      3. Acces to the DataBase to do some SQL queries.

      Scenario 1: Delete cache assets when removing a library.

      1. Login as an admin.
      2. Go to Course1.
      3. Add a new Label and use Atto Editor to "Insert H5P" in the Label text.
        1. Add the chart-7143.h5p attached in the issue.
      4. Save and return to the course.
      5. Go to the DataBase and run this query

        SELECT * FROM `mdl_h5p_libraries_cachedassets`
        

        1. Confirm you should see only one row. Please, copy the value of the hash column in the notepad.
      6. Now, in the DataBase, you should run this other query and you have to substitute in the query the HASHVALUECOPIEDBEFORE tag with the value previously copied in the notepad.

        SELECT *  FROM `mdl_files` WHERE `filename` LIKE 'HASHVALUECOPIEDBEFORE%'
        

        1. Confirm you should see two rows where the filename columns contain these values, HASHVALUECOPIEDBEFORE.js and HASHVALUECOPIEDBEFORE.css
      7. Now, go to the Site Administration / H5P / Manage H5P content types
      8. Confirm you could see in the Installed H5P libraries tab, H5PEditor.ColorSelector library with 1.2.5 version.
      9. Upload the chart-new-library-1-2-6-740633.h5p attached file in the H5P content type field.
      10. Expected result: You could see this message 'H5P content types uploaded successfully 'in background green. Also, you could see in in the Installed H5P libraries tab, H5PEditor.ColorSelector library with 1.2.6 version.
      11. Go to the DataBase and you should run the same query in Step 5.
        1. Expected result: you shouldn't see any row.
      12. Now, in the DataBase, you should run the same query in Step 6.
      13. Expected result: you shouldn't see any row.
      Show
      Setup Moodle Site with one course named course1. Acces as admin in the Moodle Site. Acces to the DataBase to do some SQL queries. Scenario 1: Delete cache assets when removing a library. Login as an admin. Go to Course1. Add a new Label and use Atto Editor to "Insert H5P" in the Label text. Add the chart-7143.h5p attached in the issue. Save and return to the course. Go to the DataBase and run this query SELECT * FROM `mdl_h5p_libraries_cachedassets` Confirm you should see only one row. Please, copy the value of the hash column in the notepad. Now, in the DataBase, you should run this other query and you have to substitute in the query the HASHVALUECOPIEDBEFORE tag with the value previously copied in the notepad. SELECT * FROM `mdl_files` WHERE `filename` LIKE 'HASHVALUECOPIEDBEFORE%' Confirm you should see two rows where the filename columns contain these values, HASHVALUECOPIEDBEFORE.js and HASHVALUECOPIEDBEFORE.css Now, go to the Site Administration / H5P / Manage H5P content types Confirm you could see in the Installed H5P libraries tab, H5PEditor.ColorSelector library with 1.2.5 version. Upload the chart-new-library-1-2-6-740633.h5p attached file in the H5P content type field. Expected result: You could see this message 'H5P content types uploaded successfully 'in background green. Also, you could see in in the Installed H5P libraries tab, H5PEditor.ColorSelector library with 1.2.6 version. Go to the DataBase and you should run the same query in Step 5. Expected result: you shouldn't see any row. Now, in the DataBase, you should run the same query in Step 6. Expected result: you shouldn't see any row.

    Description

      The cache assets linked to a library have to be removed also when a library is deleted, in order to rebuild them again next time they are required.

      It has been fixed in MDL-67062 but the patch should be backported to 3.8.

      Attachments

        1. 10.png
          10.png
          224 kB
        2. 11.1.png
          11.1.png
          127 kB
        3. 13.png
          13.png
          239 kB
        4. 5.1.png
          5.1.png
          180 kB
        5. 6.1.png
          6.1.png
          332 kB
        6. 8.png
          8.png
          61 kB
        7. chart-7143.h5p
          107 kB
        8. chart-new-library-1-2-6-740633.h5p
          110 kB

        Issue Links

          Activity

            People

              cescobedo Carlos Escobedo
              sarjona Sara Arjona (@sarjona)
              Sara Arjona (@sarjona) Sara Arjona (@sarjona)
              Jun Pataleta Jun Pataleta
              Mathew May Mathew May
              Amaia Anabitarte, Carlos Escobedo, Laurent David, Mikel Martín Corrales, Sabina Abellan, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                11/May/20

                Time Tracking

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