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

H5P deployment needs to lock

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.8, 3.9
    • Fix Version/s: 3.9
    • Component/s: H5P
    • Testing Instructions:
      Hide

      Setup

      1. Upload the test-h5p.html file to the $CFG->wwwroot.
      2. Access to the private files block.
      3. Upload the files course-presentation.h5p, interactive-video.h5p and chart-7143.h5p  to the root folder.
      4. In case your instance is not a clean instance you should empty most H5P tables using this queries:

      DELETE FROM mdl_h5p_contents_libraries;
      DELETE FROM mdl_h5p_libraries_cachedassets;
      DELETE FROM mdl_h5p_library_dependencies;
      DELETE FROM mdl_h5p_libraries;
      DELETE FROM mdl_h5p;
      DELETE FROM mdl_files where component = 'core_h5p';

      Testing scenario 1: Don't allow to deploy the same H5P file synchronously.

      1. Login as admin in your Moodle in the two different browsers.
      2. In the Private files block, copy the URL for the file course-presentation.h5p.
      3. Open $CFG->wwwroot/test-h5p.html in the two different browsers.
      4. Paste the URL copy in step 2 into the input box named H5P Url in the two different browsers.
      5. Go to one browser and click on the  Display button.
      6. Go to the second browser and wait 3 seconds before to click on the Display button.
      7. Now you have to wait.
      8. Expected result: You should see in the second browser the next message "This H5P content cannot be accessed because it is being deployed. Please try again later.";
      9. Wait to H5P file is deployed in the first browser. Once, you could see the H5P content go to the second browser and reload the tab.
      10. Expected result: You should see the beautiful H5P content without errors.

      Testing scenario 2: Allow to deploy the differents H5P file synchronously.

      1. Login as admin in your Moodle in the two different browsers.
      2. In the Private files block, copy the URL for the file interactive-video.h5p.
      3. Open $CFG->wwwroot/test-h5p.html in the two different browsers.
      4. Paste the URL copy in step 2 into the input box named H5P Url in one browser.
      5. Go to the second browser and copy the URL for the file chart-7143.h5p in the Private files.
      6. Go to one browser and click on Display.
      7. Go to the second browser and wait 3 seconds before to click on the  Display button.
      8. Expected result: You should see in the second browser the H5P content from chart-7143.h5p without errors.
      9. Wait to H5P file is deployed in the first browser. 
      10. Expected result: You should see another beautiful H5P content without errors.
      Show
      Setup Upload the test-h5p.html file to the $CFG->wwwroot. Access to the private files block. Upload the files course-presentation.h5p, interactive-video.h5p and chart-7143.h5p  to the root folder. In case your instance is not a clean instance you should empty most H5P tables using this queries: DELETE FROM mdl_h5p_contents_libraries; DELETE FROM mdl_h5p_libraries_cachedassets; DELETE FROM mdl_h5p_library_dependencies; DELETE FROM mdl_h5p_libraries; DELETE FROM mdl_h5p; DELETE FROM mdl_files where component = 'core_h5p'; Testing scenario 1: Don't allow to deploy the same H5P file synchronously. Login as admin in your Moodle in the two different browsers. In the Private files block, copy the URL for the file  course-presentation.h5p . Open $CFG->wwwroot/test-h5p.html in the two different browsers. Paste the URL copy in step 2 into the input box named H5P Url in the two different browsers. Go to one browser and click on the  Display button. Go to the second browser and wait 3 seconds before to click on the Display button. Now you have to wait. Expected result:  You should see in the second browser the next message "This H5P content cannot be accessed because it is being deployed. Please try again later." ; Wait to H5P file is deployed in the first browser. Once, you could see the H5P content go to the second browser and reload the tab. Expected result: You should see the beautiful H5P content without errors. Testing scenario 2: Allow to deploy the differents H5P file synchronously. Login as admin in your Moodle in the two different browsers. In the Private files block, copy the URL for the file interactive-video.h5p. Open $CFG->wwwroot/test-h5p.html in the two different browsers. Paste the URL copy in step 2 into the input box named H5P Url in one browser. Go to the second browser and copy the URL for the file chart-7143.h5p in the Private files. Go to one browser and click on Display. Go to the second browser and wait 3 seconds before to click on the  Display button. Expected result:  You should see in the second browser the H5P content from chart-7143.h5p without errors. Wait to H5P file is deployed in the first browser.  Expected result: You should see another beautiful H5P content without errors.
    • Affected Branches:
      MOODLE_38_STABLE, MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_39_STABLE
    • Pull Master Branch:
      MDL-67095-master

      Description

      When deploying a new H5P resource we need to ensure that we don't start deploying the same H5P in another thread (e.g. for another session/user).

      At the moment this is possible:

      1. Login as a user and upload the course-presentation.h5p
      2. Use the test-h5p.html file to test it
      3. Whilst it unpacks open a different browser or a private browsing tab
      4. Log in at the same user (or a different one) and view the same h5p file again
      5. Wait
      6. Observe that in the 2nd and all subsequent loads we get a warning:

        Error: mdb->get_record() found more than one record!
        line 1599 of /lib/dml/moodle_database.php: call to debugging()
        line 1559 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()
        line 1538 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
        line 235 of /h5p/classes/player.php: call to moodle_database->get_record()
        line 101 of /h5p/classes/player.php: call to core_h5p\player->get_h5p_id()
        line 39 of /h5p/embed.php: call to core_h5p\player->__construct()
        

        Attachments

        1. chart-7143.h5p
          107 kB
        2. course-presentation.h5p
          4.14 MB
        3. interactive-video.h5p
          2.84 MB
        4. screenshot-1.png
          screenshot-1.png
          771 kB
        5. test-h5p.html
          0.5 kB

          Issue Links

            Activity

              People

              Assignee:
              cescobedo Carlos Escobedo
              Reporter:
              dobedobedoh Andrew Nicols
              Peer reviewer:
              Ferran Recio
              Integrator:
              Jun Pataleta
              Tester:
              Janelle Barcega
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                15/Jun/20

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 2 hours, 15 minutes
                  1d 2h 15m