Can't update some content types /translation[i] undefined

After I upgraded all contenttypes and h5p-activity to the newest version I can't update some contenttypes. for example interactive video or 360 tour. If I click on "save" a js bug appears (see image). Maybe something with translation?

here are my details:

Moodle 4.0.2+ (Build: 20220714)

Language: german

Console: translation[i] is undefined

H5P Activity: 1.22.4 2022012000

Desktop

 

 

 

BV52's picture

Hi,

Have you tried downloading the sample contents and uploading it into Moodle?

-BV

yes. I installed the newest content types.

https://moodle.org/plugins/qformat_h5p

otacke's picture

Hi!

I think the German translation file is just fine for those content types mentioned. Not sure why you think that the qformat plugin is relevant here.

Have you by any chance customized semantics.json of those content types using H5P hooks? For instance added or moved fields? That would explain why the counterpart in the translations cannot be found.

Best,
Oliver

I did an ugly hack in /mod/hvp/editor/scripts/h5peditor.js

 if (!translation[i]){
       translation[i] = {field: ""};
    }

Now all works fine. I can't find the file semantics.json. Maybe I can update that to fix the bug the right way? I didn't any changes there.

Thank you very much for your help.

otacke's picture

Hi!

The file semantics.json is not part of H5P core but is supplied by every content type to tell H5P what fields the editor should provide. Translations must match the structure of that json file.

I do not recommend changing files directly, but to use the hooks that H5P supplies.

Best,

Oliver 

yes. I installed all new content types. https://moodle.org/plugins/qformat_h5p for the plugin hvp (not the moodle integration). I still use the activity plugin.

yes. I installed all new content types. https://moodle.org/plugins/qformat_h5p for the plugin hvp (not the moodle integration). I still use the activity plugin.

 

I can confirm the same problem: I have updated to the latest H5P plugin for Moodle. Then all content types updated. In the Interactive Book type I get the error mentioned above when embedding interactive videos and end up in a "loading loop". Pascal's ugly hack doesn't work here. I haven't made any changes locally.

Temporary solution for me: Switching the language from "German" to "English". Something seems to have been shot in the German language file.

Hope for a fix in the next update :-(