Errors due to content libraries being loaded before main H5P libraries

Created on 29 July 2024, 5 months ago

Hello,

After the Drupal 10 upgrade, I noticed the content libraries, located in /sites/default/files/h5p/libraries, are being loaded before the main libraries h5p.js and jquery.js, located in the vendor directory in the module folder, and also before the file h5p-event-dispatcher.js, which I believe is where the aforementioned function is defined and constructed. Please see the attached screenshot.

Shouldn't the main libraries be loaded before, in order to ensure all the H5P core functionality is properly defined? Is this an issue you have experienced before? Any recommendations on how to solve this?

Please let me know if you have any questions.

Thank you!

🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇨🇦Canada maursilveira Windsor, ON

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @maursilveira
  • 🇨🇦Canada maursilveira Windsor, ON

    I'm fairly new to this module, and I have a question: shouldn't the library h5p/h5p.content be a dependency to all installed content libraries (in sites/default/files/h5p/libraries)? I believe this is the reason Drupal isn't guaranteeing those main H5P libraries are not being loaded before the content libraries.

  • Status changed to Needs review 5 months ago
  • 🇨🇦Canada maursilveira Windsor, ON

    I created a merge request for the fix. It registers the installed content libraries as dependent on the H5P main core library. This solves the errors, properly defining and constructing the H5P functions prior to their usage by the installed content libraries.

    Please let me know if you have any questions about this. Thank you.

  • 🇨🇦Canada maursilveira Windsor, ON

    Please find attached a patch file with the same fix applied in the MR, if anybody needs an actual patch file.

Production build 0.71.5 2024