I am also experiencing the same issue:
Drupal 9.4.13
PHP 8.0.27
Version: 2.0.0-alpha3Using the Opigno distribution, when I go to add a new Question Set OR when I try to load an existing Question Set I get the following Errors in the console:
GET https://libraries/H5PEditor.TableList-1.0/h5p-editor-table-list.css?ver=... net::ERR_NAME_NOT_RESOLVED
GET https://libraries/H5PEditor.RangeList-1.0/h5p-editor-range-list.css?ver=... net::ERR_NAME_NOT_RESOLVED
GET https://libraries/H5PEditor.ShowWhen-1.0/h5p-show-when.css?ver=1.0.9 net::ERR_NAME_NOT_RESOLVED
GET https://libraries/FontAwesome-4.5/h5p-font-awesome.min.css?ver=4.5.4 net::ERR_NAME_NOT_RESOLVED
GET https://libraries/H5PEditor.VerticalTabs-1.3/styles/css/vertical-tabs.cs... net::ERR_NAME_NOT_RESOLVED
GET https://libraries/H5PEditor.QuestionSetTextualEditor-1.3/dist/question-s... net::ERR_NAME_NOT_RESOLVEDThe functionality for the call is here:
/modules/contrib/h5p/vendor/h5p/h5p-editor/scripts/h5peditor.jsThis is where the code seems to have issues:
ns.libraryRequested = function (libraryName, callback) { var libraryData = ns.libraryCache[libraryName]; if (!ns.libraryLoaded[libraryName]) { // Add CSS. if (libraryData.css !== undefined) { libraryData.css.forEach(function (path) { if (!H5P.cssLoaded(path)) { H5PIntegration.loadedCss.push(path); if (path) { ns.$('head').append('<link ' + 'rel="stylesheet" ' + 'href="' + path + '" ' + 'type="text/css" ' + '/>'); } } }); } // Add JS var loadingJs = false; if (libraryData.javascript !== undefined && libraryData.javascript.length) { libraryData.javascript.forEach(function (path) { if (!H5P.jsLoaded(path)) { loadingJs = true; ns.loadJs(path, function (err) { if (err) { console.error('Error while loading script', err); return; }
The libraryData.css & libraryData.javascript for me is the following:
[
"//libraries/H5PEditor.TableList-1.0/h5p-editor-table-list.css?ver=1.0.4",
"//libraries/H5PEditor.RangeList-1.0/h5p-editor-range-list.css?ver=1.0.12",
"//libraries/H5PEditor.ShowWhen-1.0/h5p-show-when.css?ver=1.0.9",
"//libraries/FontAwesome-4.5/h5p-font-awesome.min.css?ver=4.5.4",
"//libraries/H5PEditor.VerticalTabs-1.3/styles/css/vertical-tabs.css?ver=1.3.9"
]
[
"//libraries/H5PEditor.QuestionSetTextualEditor-1.3/dist/question-set-textual-editor.js?ver=1.3.8",
"//libraries/H5PEditor.TableList-1.0/h5p-editor-table-list.js?ver=1.0.4",
"//libraries/H5PEditor.RangeList-1.0/h5p-editor-range-list.js?ver=1.0.12",
"//libraries/H5PEditor.ShowWhen-1.0/h5p-show-when.js?ver=1.0.9",
"//libraries/H5PEditor.VerticalTabs-1.3/vertical-tabs.js?ver=1.3.9",
"//libraries/H5P.QuestionSet-1.17/presave.js?ver=1.17.1"
]1. The libraryData.css.forEach && libraryData.javascript.forEach is looping through each of these index's
2. The function H5P.cssLoaded(path) && H5P.jsLoaded(path) (found in web/modules/contrib/h5p/vendor/h5p/h5p-core/js/h5p.js) determines the position of an element in the array (it would return 0-5, and 0-4 respectfully)
3. The function ns.loadJs (found in web/modules/contrib/h5p/vendor/h5p/h5p-editor/scripts/h5peditor.js) takes in the index we are at in the array, and is creating a new script element.My Analysis:
I believe the ns.loadJs is where our issue occurs.I am not sure why.
- π§π΄Bolivia vacho Cochabamba
I see that patch #11 doesn't works over h5p works, looks that works for a some distribution.
this patch is for h5p 2.0.0 branch