h5p activities don't display - js error destructure prorperty theme

Hi everyone, 

browser: Chrome (lastest version)

Moodle: 4.3.12 and 5.0.1 (sandbox)

I'm posting this subject because I've encoutered an issue recently and I don't know how to fix it.

Some of my h5p activities don't display anaymore. But I can still edit them with the content bank. 

I have an JS error in the browser console focusing on a particular component, the "single choice set". But I have the same error with another plugin "a.Question", but I don't know which plugin it's referring to.

The issue seems to come from the file in itself by uploadind it on h5p.org I have a message for example: Missing required library H5P.Components 1.0

But by analysing the h5p file, the component is present with the correct version. To verify I just change the file type with zip.

I'm noticing that this issue impact other h5p activities. When I added it in another Moodle application where the error didn't existed the other h5p activities which worked correctly were impacted after. And if I create a new h5p with the content bank, then the issue is still here.

I reproduce this behavior on the Moodle sandbox 5.0.1

I posted an issue in the moodle tracker, but they advice me to contact you.

 

Thank you for your time, best regards

David

 

 

H5P file: 

I'm adding some picture and h5p file

otacke's picture

Hi David!

H5P.Components is part of the upcoming theming update of H5P, and the error message also points to the theming update. I do not believe H5P.Components is served via the H5P content type Hub server yet (or someone at H5P Group messed up). So either you installed H5P libraries that you fetched from the github master branch and the built - or someone else did (not knowing what he/she is doing) and shared a file with you that you (or someone else using admin rights) uploaded to your site.

You now seem to be running H5P libraries that were not meant for release (as they are still in development and rely on the next version of H5P Core). This would need to be rectified, but I doubt it's feasible to solve this by exchanging messages on the forum.

Best,

Oliver

Hi Oliver!

Thank you for your reply and this information. It help us to understand better the reason of this issue.

Otherwise, I shared another H5P file but this time, I have a problem with two H5P librairies:

Missing main library H5P.CantooLoaderDragText 1.13

Missing required library CantooWeb 1.13

I have the a similar JS error. Then, can you confirm me that it's same for this librairies? Are they a part of the upcoming theming update of H5P?

Thank you, best regards

David

otacke's picture

You're now running a development version (and one that's even outdated) of H5P.Question which is an H5P library used by plenty of content types. So you will get the same error for all content types that use it - including that weird CantooWeb content type.

otacke's picture

To be clear: That Cantoo thingie has nothing to do with H5P Group or anybody that I know.

You'll get the "Missing main library" whenever you try to upload H5P content that contains libraries which are not on the platform yet and where you do not have administrative rights to install missing libraries, cmp. https://snordian.de/2022/12/31/why-cant-i-upload-h5p-content/

otacke's picture

I just noticed that the 2nd file that you shared contains a customized version of Drag the Words with kinda hardcoded CantooWeb support. Whoever build this may also have caused your trouble (and that person also does not follow common H5P practices, uses a 10MB JavaScript file (?!?!) to add "cantoo web" and should maybe let someone review his/her stuff - the whole approach to use CantooWeb seems flawed, probably makes more sense to inject it in H5P's iframe in general instead of customizing single content types the way it's done).