h5p / moodle-mod_hvp

H5P Plugin for Moodle
GNU General Public License v3.0
133 stars 171 forks source link

HVP cannot upload new content: H5P Library version 1.25 is missing - please update #473

Open lneoj opened 2 years ago

lneoj commented 2 years ago

Hi Team,

I have an interesting issue that I need help resolving. We got an external company to create H5P activities for us. When we upload them to Moodle version 4.0.4+ with HVP 1.22.4 (2022012000) or H5P (2021051700) we get the following error

api-version-unsupported : The system was unable to install the Course Presentation component from the package, as it requires a newer version of the H5P plugin. This site is currently running version 1.24, whereas the required version is 1.25 or higher. Please upgrade and then try again.

image

The documentation regarding "api-version-unsupported" is simple just an update So I updated all the content modules but the Moodle library under the H5P folder is still version 1.24. I check Moodle GIT repository and there is only 1.24. I could not get any H5P libraries on the web. Regarding HVP I have the latest version 1.22.4

I also enabled logs to see more details

$CFG->debug = (E_ALL | E_STRICT); $CFG->debugdisplay = 1; $CFG->mod_hvp_dev = 1;

but I got only the error message above. Do you guys know how to upgrade the library in Moodle? PS: I was able to upload the content on H5P.org with no issues.

Cheers, Jerry

otacke commented 2 years ago

Hi Jerry!

It seems that your contractor is using H5P.com in order to create content. That platform is using version 1.25 of H5P core and a later version of Course Presentation that both have not yet been released elsewhere.

So, yes, the H5P core team would need to upgrade the H5P core version provided in the plugins - or you could replace the corresponding files on your platform with the versions of https://github.com/h5p/h5p-php-library and https://github.com/h5p/h5p-editor-php-library on their respective master branch. I don't know how safe that is however, as that branch holds development versions (H5P.com uses a modified version that is not public). I also do not know when version 1.25 will be released, because I am not a member of the H5P core team. @fnoks Any plans yet?

A better way to deal with this issue may be to upload the content with a user account that has the capability to create H5P content, but not to manage H5P libraries (can be defined in moodle's user role editor). That way, H5P will not try to install the later version of Course Presentation from the H5P file. The content will still work, because only the patch version of Course Presentation was changed on H5P.com and the data structure of content didn't change.

Alternatively, you could upload the content on h5p.org where you are allowed to create content, but not to manage H5P libraries - same principle as just suggested. That works as you already confirmed. If you then download the file via the reuse button, you will get a content file that holds the older version of Course Presentation which does not rely on H5P core 1.25. You can then upload that file with any user role - if H5P core 1.24 is installed that is :-)

Cheers, Oliver

lneoj commented 2 years ago

Hi Oliver,

Thank you for your message. I tried to create/inject a new h5p-php-library as well as the h5p-editor-php-library yesterday, but lots of changes in API calls and declarations as I am not a developer so I will probably wait for the core team to do the updates.

I also tried to upload the content and reuse it, but for some reason, I got an infinite loading page in Moodle with no additional errors.

I will try using your second method "A better way to deal with this issue may be to upload the content with a user account that has the capability to create H5P content, but not to manage H5P libraries (can be defined in moodle's user role editor). That way, H5P will not try to install the later version of Course Presentation from the H5P file. The content will still work, because only the patch version of Course Presentation was changed on H5P.com and the data structure of content didn't change." and response if any success. This way community knows how to apply a workaround.

Thank you once again Oliver.

Regards, Jerry