Core and mod_hvp are using the same namespace for some H5P
libraries. This is causing some random errors.
In order to get the expected behaviour in Moodle core, this patch
prepends H5P libraries in order to guarantee they are loaded first.
Plugins using same libraries will need to use a different namespace
if they overlap and a different version of these libraries should
be used.
* Register the H5P autoloader.
*/
public static function register(): void {
- spl_autoload_register([static::class, 'autoload']);
+ // Prepend H5P libraries in order to guarantee they are loaded first. Plugins using same libraries will need to use a
+ // different namespace if they want to use a different version.
+ spl_autoload_register([static::class, 'autoload'], true, true);
}
/**