Dependencies missing in Game Map

Hello!

One of my users created a Game Map about half a year ago via the moodle Content Bank. 
This one is still working in moodle right now but as soon as anything is changed it stops working.
When it is copied via the course or activity copy tool of moodle, it also stops working.

The comparison of the copied files and the one original that still works shows that dependencies are missing.
The browser specifically says that there was an error loading Advanced Text 1.1

I tried reinstalling the content type, the library, merging the ZIPs, nothing worked out so far.
I uploaded the file here, saved it and downloaded it again but it didn't help either.

Can anyone help as to where the dependencies have gone, if they will return or if there is any way I can make the copied files working or the old file editable, without losing content?

 

Thanks and best, 
Emmy

 

 

otacke's picture

That sounds like a pretty odd issue, and I fear this would have to be investigated directly on the server that runs H5P.

Since the original content still works, everything seems to be in order with "Advanced Text 1.1" at first sight, but it's possible that the GameMap content is loading its dependencies from a bundled file in H5P's cache. Then hiccups with Advanced Text might not surface.

Advanced Text has been a dependency of GameMap since its very first version, so nothing changed there. Why that dependency would get lost in export: Your guess is as good as mine.

Hi, 

I can open a new discussion if need be but this looks very similar to the issue I am currently seeing. 

We have a copy of GameMap on moodle that has been working up until recently and has started showing the AdvancedText 1.1 error. Further, if I try to create a demo of GameMap on h5p.org itself the same error seems to occur as can be seen here: https://h5p.org/node/1547744 It seems if I try to load this on Firefox, Chrome or from my Android phone this fails to load. I work on Linux and have tried to load it from a Windows VM which also fails, so I do not think its a browser/cache issue. 

I've tried creating new Moodle instances to test and the issue seems consistent in all different cases. If I reuse the GameMap from https://h5p.org/content-types/game-map this does work, but only that specific GameMap does, it doesn't seem to do anything for the other GameMaps which cannot seem to load the AdvancedText dependency.

I can see the Moodle database has the advanced text library entry as attached. Even the major and minor version values look correct to me. 

Let me know if you have any ideas of a workaround or if you need anything else. I did start looking into if there is a way to manually installed the AdvancedText library to Moodle but it doesn't look like the problem is bound to Moodle or due to AdvancedText actually being missing. 

Hi sgodbehere, 

thank you for confirming the issue! I was close to ripping my test instance of moodle apart to find the problem.
The info you provided is very helpful and I'll document it together with Oliver's patch.

I just uploaded version 1.6 and it seems to repair all the problematic files. All one needs to do after uploading the version is to save the problematic file again, even without changing anything. After that they all seem to display normally again.

Best, 

mmut

 

otacke's picture

As for the issue: That's a bug that can appear if (and only if) you add a stage without any content and then save the content. I fixed this in version 1.6.0.

Since I have no means to update my own content types on the H5P Hub, you'll have to get the fix by downloading the demo content from https://www.olivertacke.de/labs/2025/02/10/gamemap-1-4-is-out/ and then uploading it to your site with admin rights.

Best,
Oliver

Hi Oliver

Thank you so much for the patched version, you're a saint!

My professer loves to use your work and was quite downtrodden when it stopped working because he had put lots of work in it and teaches hundreds of students with it. 

Everything seems to be working well now!

Just one question: I now have four different versions of Game Map installed but in the Content Bank in moodle it lets me choose only Game Map in general. My guess is that any Game Map created there will be made in the latest version. Now, I know that if I disable the other versions via administration, then all the other Game Maps made earlier will stop working. Do you have a recommendation how to manage the content type versions in general? As moodle admin I don't have any way to influence what types and versions are loaded into moodle core, only how often the job for the update is run. I don't really mind but I wonder if there is a better way to manage that.

 

Thank you and best, 

Emmy

otacke's picture

You should update existing content to use later library versions regularly, please cmp. https://snordian.de/2024/10/30/why-should-i-upgrade-existing-h5p-content-and-how/ for details.

Once old content uses a newer version of a library, the older version can be deleted safely. That deletion may unfortunately not be straightforward (cmp. https://h5ptechnology.atlassian.net/browse/HFP-3065 which has been pending for over five years now :-().