Re-use package not being updated

We've encountered an issue where certain H5P activities are giving an incomplete .h5p file when clicking the 're-use' button. For example, we have a Course Presentation with 8 slides and if we edit the H5P activity in Moodle, we see 8 slides. However, when we click 're-use' to download the h5p package and upload this to a brand new h5p activity, only 5 slides are showing. I've tried going into the activity, making a small modification, then saving the changes (in case it's a caching issue) but this doesn't work.

So far the only way to get around this seems to be to back up the entire Moodle activity and restore it again. This ensures all 8 slides are present and when clicking 're-use' on this activity we can restore it again with all 8 slides. The issue is, the affected site could have many of these present and Teachers reusing the package may not be aware of the issue (and don't have permissions to run a backup/restore).

Is there any way to fix this or a possible cause?

Content types: 
BV52's picture

Hi phil.r,

Would you mind providing the following:

  1. Detailed steps to reproduce the bug (exactly how and when did it happen)
  2. Moodle Version: 
  3. H5P plugin version
  4. H5P content type and version (if a content type was used), and a sample URL or attached H5P.
  5. Any browser console errors
  6. Any PHP errors

If it worked before:

  1. Any recent changes to the environment (new plugins/modules, updates, configuration changes etc.)
  2. Any recent changes to the browser you're using (new extensions, updates etc.)

-BV

Hi BV,

Thanks for your reply and sorry for the delay in getting back to you. I have included some information below. Note this is for a client of ours so I have removed any references to their site URL.

Steps to reproduce:

  1. In Moodle, add a new h5p activity
  2. Choose the course presentation
  3. Add a slide
  4. Add an image to the slide
  5. Ensure 'Allow download' is ticked
  6. Save and display
  7. Click the 'Re-use' link at the bottom left
  8. Wait for the package to generate and download. On your computer note the filesize
  9. Edit the h5p activity and add an additional slide with another different image (repeat steps 2-6)
  10. Click the 'Re-use' link again. On your computer note the filesize

Observed behaviour:

The h5p package file generated is the same size regardless of how much content you add in. Adding more images should increase the package size. Restoring this file to an h5p activity causes it to display the initial activity that was created with only one image i.e. the package file is not updating when the content is updated.

Expected behaviour:

When content is changed within the h5p activity, the h5p package file is re-generated to produce an updated backup file

Moodle Version: 3.7.3

H5P plugin version: 1.20.1 (2019111300)

H5P content type and version: Course Presentation (1.21.6)

Any browser console errors: view.php?id=1503706&forceview=1:1 A cookie associated with a resource at http://<siteurl>/ was set with `SameSite=None` but without `Secure`. It has been blocked, as Chrome now only delivers cookies marked `SameSite=None` if they are also marked `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5633521622188032.

DevTools failed to parse SourceMap: https://<siteurl>/lib/requirejs.php/1581077458/core/question.min.js.map

h5p.js?ver=2019111300:1286 Resource interpreted as Document but transferred with MIME type application/zip: "https://<siteurl>/pluginfile.php/2182470/mod_hvp/exports/test-download-package-7837.h5p".

(anonymous) @ h5p.js?ver=2019111300:1286

dispatch @ jquery.js?ver=2019111300:2

v.handle @ jquery.js?ver=2019111300:2

Any PHP errors: Have yet to find any PHP errors

If it worked before: Unsure

Any recent changes to the environment (new plugins/modules, updates, configuration changes etc.): Unsure

Any recent changes to the browser you're using (new extensions, updates etc.): Unsure

Hi BV,

Are there any updates on this and has anyone else been able to replicate the same issue?

Thanks,
Phil.

BV52's picture

Hi Phil,

I apologize I haven't heard anything from the core team, they are a bit busy as of the moment with the OER Hub. I hope we get some input/suggestion from the community.

-BV

I can still replicate this issue, are there any updates? 

i have something similar happening in drupal when i download an h5p file , i get another h5p file that i used previously an old one, not the new one at all. 

i noticed that when i click on reuse, it is not getting the right file sometimes.  the right one is in the sites/default/files/h5p/export directory however.