H5P moodle problem

Hello,

I have a problem with my H5P plugin, installed in moodle. The problem is that it does not load the coure presentation. It shows '[field:group:coursepresentation:presentation]'

After opening an H5P activity it shows 'Exception - Class 'finfo' not found'

and the error show on the console is: 

'Uncaught ReferenceError: H5PIntegration is not defined

    at Object.H5P.t (h5p.js?ver=2018012200:882)

    at HTMLDocument.<anonymous> (h5p.js?ver=2018012200:2039)

    at c (jquery.js?ver=2018012200:2)

    at Object.fireWith [as resolveWith] (jquery.js?ver=2018012200:2)

    at Function.ready (jquery.js?ver=2018012200:2)

    at HTMLDocument.H (jquery.js?ver=2018012200:2) '

How can I solve this problem?

Thank you.

BV52's picture

Hi utest94,

In order to give your bug report the best chance of getting answered, please include the following information:

  1. Detailed steps to reproduce the bug (exactly how and when did it happen)
  2. Platform and version number. E.g. Drupal, Wordpress, Moodle.
  3. Mobile or Desktop
  4. Browser: Chrome, Firefox, Safari etc
  5. H5P plugin version
  6. H5P content type and version (if a content type was used), and a sample URL or attached H5P.
  7. Any browser console errors
  8. Any PHP errors
  9. Screenshots if it's a visual problem

The more information you provide, the quicker the community will be able to fix it and the quicker you'll have a working solution!

-BV52

Hello,

I have installed H5P plugin version 1.7, on my moodle account with version 3.3.1. When I create a H5P activity (course presentation) on a course,  there is appeared a problem shown below.

[field:group:coursepresentation:presentation]

When I save and display this activity, it shows this error on the screen 

Exception - Class 'finfo' not found

and this one on the console

Uncaught ReferenceError: H5PIntegration is not defined

    at Object.H5P.t (h5p.js?ver=2018012200:882)

    at HTMLDocument.<anonymous> (h5p.js?ver=2018012200:2039)

    at c (jquery.js?ver=2018012200:2)

    at Object.fireWith [as resolveWith] (jquery.js?ver=2018012200:2)

    at Function.ready (jquery.js?ver=2018012200:2)

    at HTMLDocument.H (jquery.js?ver=2018012200:2)

How can I solve this problem, pls?

Thanks

BV52's picture

Hi utest94,

Can you try downloading and uploading to Moodle this test content and see if this will resolve the issue.

-BV52

Hi,

I downloaded and tried to upload the content you just gave above, but the loading is too slow, and after loading it shows just a red line (like an error) without text inside.

otacke's picture

Hi utest94!

The error you're describing points to finfo (fileinfo), which is not a part of H5P or moodle, but an extension of PHP on the server that you're using. As far as I know, it should be installed by default nowadays, but maybe you or your system administrator could check on that.

Hi,

I just installed the fileinfo php extension, and the error about the finfo has gone, but now it shows another problem if I view a course presentation on H5P. It shows 'Exception - Call to a member function get_content() on boolean' kind of error. 

and If I want to create a course presentation, I can't.

otacke's picture

Hi utest94!

This is also an error message from PHP, and as far as I can see, get_content() belongs to moodle's File API. Have you already checked the PHP logfile for more information?

on my console it shows:

h5p.js?ver=2018012200:882 Uncaught ReferenceError: H5PIntegration is not defined

    at Object.H5P.t (h5p.js?ver=2018012200:882)

    at HTMLDocument.<anonymous> (h5p.js?ver=2018012200:2039)

    at c (jquery.js?ver=2018012200:2)

    at Object.fireWith [as resolveWith] (jquery.js?ver=2018012200:2)

    at Function.ready (jquery.js?ver=2018012200:2)

 

    at HTMLDocument.H (jquery.js?ver=2018012200:2)

If I turn on the debugger mode on moodle, than these errors are shown:

Debug info: 
Error code: generalexceptionmessage×Stack trace:
  • line 258 of /mod/hvp/classes/file_storage.php: Error thrown
  • line 2124 of /mod/hvp/library/h5p.classes.php: call to mod_hvp\file_storage->cacheAssets()
  • line 183 of /mod/hvp/classes/view_assets.php: call to H5PCore->getDependenciesFiles()
  • line 82 of /mod/hvp/classes/view_assets.php: call to mod_hvp\view_assets->getdependencyfiles()
  • line 44 of /mod/hvp/view.php: call to mod_hvp\view_assets->__construct()
thomasmars's picture

Hi,

From your error message it looks like H5P think you have a library file, but when it looks for the file it finds that it doesn't exist and throws an error. I think this has happened because an incosistency between your file system and your database when you tried to install content types/libraries without the finfo php extension installed, i.e. the libraries were only installed in your database, but the files were never transferred to your moodledata storage.

If you don't have a lot of content, then I think the simplest solution to this problem is to try to reinstall the H5P plugin (make sure that all H5P database tables are cleared out), and then install the content types through the content type hub (editor). Please let us know how this progresses along.

Hi,

thanks for your explanation. Is there any way to solve this, without removing and reinstalling H5P plugin? Anything that I can add to moodledata?

icc's picture

Hi,

What you can do is try to reinstall the content types manually. To do this you'll have to add the following to your config.php:

$CFG->mod_hvp_dev = true;

Also, to catch any error while doing so, it's useful to add the following as well:

@error_reporting(E_ALL | E_STRICT);   // NOT FOR PRODUCTION SERVERS!
@ini_set('display_errors', '1');         // NOT FOR PRODUCTION SERVERS!
$CFG->debug = (E_ALL | E_STRICT);   // === DEBUG_DEVELOPER - NOT FOR PRODUCTION SERVERS!
$CFG->debugdisplay = 1;              // NOT FOR PRODUCTION SERVERS!

But remember to remove all of these lines when you're done so they don't cause problems for you in the future.

Once you've added the lines go to the Libraries Managment page /mod/hvp/library_list.php where you'll see an upload form. Here you can upload the broken content types to fix them.
To find the file you need to upload go to the Examples & Downloads page, select e.g. Course Presentation and the use the little download button in the lower left corner of content. Once the file is downloaded, upload it to your site via the form.

Let me know how it works out.

Hi,

Thank you very much. It worked! :D

icc's picture

That is great to hear, makes me happy!

icc's picture

Which PHP version are you running? I see that others have had similar issues when using PHP 7.1.

Hi icc,

I am using PHP 7.0. Which might be the problem?

In my case, in the google chrome debugger I get the similar message:

h5p.js?ver=-1:997 Uncaught ReferenceError: H5PIntegration is not defined

    at H5P.t (h5p.js?ver=-1:997:3)

    at HTMLDocument.<anonymous> (h5p.js?ver=-1:2717:18)

    at u (jquery.js?ver=-1:2:27579)

    at Object.fireWith [as resolveWith] (jquery.js?ver=-1:2:28337)

    at Function.ready (jquery.js?ver=-1:2:30124)

 

    at HTMLDocument._ (jquery.js?ver=-1:2:27307)

And this is displayed on the screen:


Trazado de la pila (stack):

  • line 682 of /h5p/classes/file_storage.php: Error thrown
  • line 236 of /h5p/classes/file_storage.php: call to core_h5p\file_storage->concatenate_files()
  • line 2446 of /h5p/h5plib/v124/joubel/core/h5p.classes.php: call to core_h5p\file_storage->cacheAssets()
  • line 436 of /h5p/classes/player.php: call to H5PCore->getDependenciesFiles()
  • line 366 of /h5p/classes/player.php: call to core_h5p\player->get_dependency_files()
  • line 221 of /h5p/classes/player.php: call to core_h5p\player->get_assets()
  • line 66 of /h5p/embed.php: call to core_h5p\player->add_assets_to_page()


Is there a way to know if there is a library that is giving incompatibility?
Thanks