Unable to work with slides in Course Presentation

We have H5P as a part of our Totara package. On one of our installations the icons for adding, duplicating slides etc. is not present. I have updated to the latest version.

I used desktop browsers, chrome and edge. There are no error codes.

 

otacke's picture

If there are no console logs (are you sure?), then there's no way to help you remotely without gaining access to one of the contents that shows the behavior that you describe.

Hello and thanks for the quick reply. I would not know how to access these console logs. As of now, all of our developers are on vacation. They might be able to help me once they get back...

otacke's picture

Please have a look at https://snordian.de/2024/02/17/how-can-i-craft-an-effective-bug-report-for-h5p-components/ for details on how to access the console. 

These are the errors in the console logs:

Uncaught TypeError: Cannot read properties of undefined (reading 'includes')

    at ns.Html.createHtml (h5peditor-html.js?ver=2023112800:570:23)

    at ns.Html.appendTo (h5peditor-html.js?ver=2023112800:399:26)

    at ns.processSemanticsChunk (h5peditor.js?ver=2023112800:491:19)

    at createRadioContent (radio-selector.js?ver=1.2.2:112:17)

    at RadioSelector.self.appendTo (radio-selector.js?ver=1.2.2:276:7)

    at ns.processSemanticsChunk (h5peditor.js?ver=2023112800:491:19)

    at BackgroundSelector.self.addBgSelector (bg-selector.js?ver=1.25.14:191:17)

    at initBgSelectors (slide-selector.js?ver=1.25.14:70:10)

    at SlideSelector.self.appendTo (slide-selector.js?ver=1.25.14:350:7)

    at H5PEditor.CoursePresentation.appendTo (cp-editor.js?ver=1.25.14:279:6)

h5peditor-html.js?ver=2023112800:570  Uncaught TypeError: Cannot read properties of undefined (reading 'includes')

    at ns.Html.createHtml (h5peditor-html.js?ver=2023112800:570:23)

    at ns.Html.appendTo (h5peditor-html.js?ver=2023112800:399:26)

    at ns.processSemanticsChunk (h5peditor.js?ver=2023112800:491:19)

    at h5peditor-library.js?ver=2023112800:402:8

    at h5peditor.js?ver=2023112800:239:13

    at ns.libraryRequested (h5peditor.js?ver=2023112800:166:7)

    at Object.success (h5peditor.js?ver=2023112800:238:14)

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

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

    at l (jquery.js?ver=2023112800:2:79800)

These are the errors from the console log:

Uncaught TypeError: Cannot read properties of undefined (reading 'includes')

    at ns.Html.createHtml (h5peditor-html.js?ver=2023112800:570:23)

    at ns.Html.appendTo (h5peditor-html.js?ver=2023112800:399:26)

    at ns.processSemanticsChunk (h5peditor.js?ver=2023112800:491:19)

    at createRadioContent (radio-selector.js?ver=1.2.2:112:17)

    at RadioSelector.self.appendTo (radio-selector.js?ver=1.2.2:276:7)

    at ns.processSemanticsChunk (h5peditor.js?ver=2023112800:491:19)

    at BackgroundSelector.self.addBgSelector (bg-selector.js?ver=1.25.14:191:17)

    at initBgSelectors (slide-selector.js?ver=1.25.14:70:10)

    at SlideSelector.self.appendTo (slide-selector.js?ver=1.25.14:350:7)

    at H5PEditor.CoursePresentation.appendTo (cp-editor.js?ver=1.25.14:279:6)

h5peditor-html.js?ver=2023112800:570  Uncaught TypeError: Cannot read properties of undefined (reading 'includes')

    at ns.Html.createHtml (h5peditor-html.js?ver=2023112800:570:23)

    at ns.Html.appendTo (h5peditor-html.js?ver=2023112800:399:26)

    at ns.processSemanticsChunk (h5peditor.js?ver=2023112800:491:19)

    at h5peditor-library.js?ver=2023112800:402:8

    at h5peditor.js?ver=2023112800:239:13

    at ns.libraryRequested (h5peditor.js?ver=2023112800:166:7)

    at Object.success (h5peditor.js?ver=2023112800:238:14)

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

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

    at l (jquery.js?ver=2023112800:2:79800)

otacke's picture

The error seems to be triggered in H5P core, not Course Presentation. More specifically, it is caused by the HTML editor widget. It is not clear what the version of H5P is that you are running, because the mentioned version (2023112800) does not match any official version of the H5P plugin for moodle, so it may be a Totara specific patch.

The code of the file h5peditor-html.js of  before Nov 28, 2023 (https://github.com/h5p/h5p-editor-php-library/blob/29efa4c40fe59bf8689ed30f8a0fa6753c8dc43a/scripts/h5peditor-html.js derived from the version number code) does not even contain 570 lines of code, but the error is said to have been caused in line 570.

So, all in all, without knowing what code that Totara version uses, without having access to your H5P editor and without an option to (quickly) reproduce this, I doubt that the H5P community can help you here.

I don't know how Torara what H5P integration Totara uses or how it handles plugins, but either way, the version of H5P core that you are using is outdated and may be the culprit. So, if possible/available, you might want to update Totara/the H5P plugin to the latest version in ordee to see if that makes a difference.