Can't update some content types /translation[i] undefined
Submitted by pascal.schaerli on Tue, 09/06/2022 - 23:04
Forums:
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
Content types:
BV52
Wed, 09/07/2022 - 18:33
Permalink
Hi,Have you tried downloading
Hi,
Have you tried downloading the sample contents and uploading it into Moodle?
-BV
pascal.schaerli
Wed, 09/07/2022 - 21:30
Permalink
yes. I installed the newest
yes. I installed the newest content types.
https://moodle.org/plugins/qformat_h5p
otacke
Thu, 09/08/2022 - 14:43
Permalink
Hi!I think the German
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
pascal.schaerli
Fri, 09/09/2022 - 15:24
Permalink
semantics.json
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
Fri, 09/09/2022 - 18:03
Permalink
Hi!The file semantics.json is
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
pascal.schaerli
Wed, 09/07/2022 - 21:32
Permalink
yes. I installed all new
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.
pascal.schaerli
Wed, 09/07/2022 - 21:33
Permalink
Yes
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.
mz83
Fri, 10/14/2022 - 07:37
Permalink
I can confirm the same problem
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 :-(