Add new H5P activity results http 500 error in Moodle v3.9 - Class core_h5p\\file_storage contains 1 abstract method...
Submitted by klorinczi on Mon, 03/25/2024 - 12:13
Using Moodle v3.9, mod_h5pactivity version 2020061500, PHP v7.4.33.
When I add new H5P activity into a course, it results http 500 error in Moodle v3.9.
After checking webserver logs, I see the following error:
PHP Fatal error: Class core_h5p\\file_storage contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (H5PFileStorage::deleteLibrary) in /srv/www/moodle/htdocs/h5p/classes/file_storage.php on line 37, referer: https://mymoodle/course/view.php?id=123
Is this a bug?
Could be possible to fix this?
klorinczi
Mon, 01/13/2025 - 11:20
Permalink
I also get this fatal error
I also get this fatal error on Moodle cron log:
PHP Fatal error: Declaration of core_h5p\file_storage::delete_library(array $library): void must be compatible with H5PFileStorage::delete_library($library) in /srv/www/moodle/htdocs/h5p/classes/file_storage.php on line 563
vishwakarmayojana
Tue, 02/25/2025 - 08:58
Permalink
This error occurs because the
This error occurs because the
core_h5p\file_storage
class in Moodle v3.9 does not fully implement the requiredH5PFileStorage
methods, specificallydeleteLibrary()
. This could be due to an incompatibility between your Moodle version and themod_h5pactivity
plugin version.Possible Fixes:
mod_h5pactivity
is the correct version for Moodle 3.9. Try updating it to the latest compatible version.deleteLibrary()
– If updating isn’t an option, you may need to modify/h5p/classes/file_storage.php
and implement the missing method from H5P’s API.If the issue persists, checking Moodle’s tracker or community forums for similar bug reports might help.
otacke
Tue, 02/25/2025 - 21:19
Permalink
Yeah, well, has that
Yeah, well, has that suggestion been generated by a LLM? :-)
The files in `h5p/classes` that throw the error are not part of the `
mod_h5pactivity
plugin`. Both work completely independently, so the plugin should not play a role at all here.Moodle 3.9 shipped with h5plib/v124 that contains version 1.24 of H5P core. That combination is absolutely fine. And that version doesn't specify the `deleteLibrary` function in the interface. That was introduced in H5P core 1.26.
If I had to guess, then I'd say someone tried to run h5plib/v126 or h5plib/v127 on Moodle 3.9, probably to make newer content type versions work, and that would result in the error message.
But why should have to guess ... @klorinczi Could you please elaborate on your setup?