0

I'm having an issue where my H5P assets are not loading in my 3.11.2 Moodle site.

Unable to find constructor for: H5P.CoursePresentation

A forum post on the H5P site suggested that I add $CFG->mod_hvp_aggregate_assets = '0'; to the config file on the LMS. However, there are no resources within Moodle to this line, no other forum posts to go off and it is not referenced in the sample config file provided by Moodle either.

Upon testing the config, the content now loads.

Does anyone know what this does? Are there any implications that could affect other parts of the site?

Naynay
  • 101
  • 1
  • 4
  • Have you asked on their forums? – Nigel Ren Sep 30 '21 at 06:45
  • @NigelRen I tried to, but after creating an account on the site it won't let me post to the forum. – Naynay Sep 30 '21 at 06:52
  • "Unable to find constructor for: ..." usually means that something went wrong when installing an update of a content type. You should be able to fix it by downloading the respective demo content from h5p.org and then uploading that to moodle. The aggregate assets variable will determine whether all the Javascripts of different libraries will be bundled or not, but AFAIK that variable is only available for the H5P plugin for moodle, not for moodle's own H5P integration in moodle core. – Oliver Tacke Oct 13 '21 at 23:01
  • @OliverTacke this is existing custom content that broke after a Moodle version upgrade. The content worked after the upgrade and then broke 2 weeks down the line. – Naynay Oct 15 '21 at 06:06
  • @Naynay a) Do you have the moodle task running that automatically updates H5P libraries (`\core\task\h5p_get_content_types_task`)? b) Does my suggestion fix your issue? – Oliver Tacke Oct 15 '21 at 11:26

2 Answers2

1

Looks like this is javascript code rather than php code.

First thing I usually do is to clear the cache.

Could you try turning off the js cache in moodle and see if that fixes it.

You can either add this line to config.php

$CFG->cachejs = false;

Or disable it via Site administration > Appearance > AJAX and Javascript > Cache Javascript

Refresh and if it works then it was probably just cache. Don't forget to turn it back on.

If it still doesn't work, then try recreating the presentation but one step at a time. Save, test, until it breaks.

Russell England
  • 9,436
  • 1
  • 27
  • 41
  • Thank you so much for this answer! We did try to clear the JS cache, and the issue persisted. – Naynay Oct 08 '21 at 11:01
0

There is something wrong with the database. What I did was empty h5p tables, reconfig programmed task for h5p to run immediately, wait for the automatic installation of the libraries. Then it works.

be careful, you have to backup everything