.h5p files downloaded from local server do not upload correctly into H5P

I setup a local XAMPP server with Drupal 8, and then used the H5P module to create presentations. I need to download the presentations from the local server and upload them to other web servers. Something is wrong with the ".h5p" files that I download from the H5P module installed on my local server.

I can download these from the the plugin on my machine without issue, but when I upload these files into my H5P on the local server I get this error message:

"The main h5p.json file is not valid

A valid main h5p.json file is missing"

I am able to successfully upload and edit .h5p files directly from the H5P website, for example the Cloudberry presentation. However, when I download this presentation from my local server and then try to upload it again onto the local server (as a test), I get the same error message. It appears the issue is with the way my H5P is formatting the files it downloads.

Can anyone figure out a way to correct this issue?

 

icc's picture

This is indeed a bug in the Drupal 8 module. 
I've created a fix for it that will be part of the next version: 223bb2a

If you would like to get it working straight away you may follow these instructions:

  1. Edit line 170 of the file src/Entity/H5PContent.php within the H5P module. You are replacing $this->library->title, with $this->library->name,
  2. Next, you need to reset the already generated .h5p files, this means deleting all the files inside the sites/default/files/h5p/exports/ folder (or just entire folder if you prefer) and then clear the cache in Drupal (admin/config/development/performance).
  3. Now, reload the page with you H5P and try to hit the download button again. You should now get a working .h5p file which can be uploaded elsewhere.

The steps you outlined above fixed the problem. Thanks so much!