How to reinstall corrupted content type?


I am working client-side in Moodle 3.17 utilizing H5P. Our LMS is maintained by an outside host, so I do not have much access to raw files or HUBs.

I recently uploaded a Column1.15 I built in Lumi to our Moodle, and unfortunately, I didn't reliaze that my older personal content mods would overwrite H5P core files, even as an end user. I'm fairly certain that the problem is localized to edits made to Column-1.15.'s semantics.json and h5p-column.js files... My first question: would issues created by edits to this content type have affected the libraries as well?

I'd like to hope that running a scheduled update would fix the problem by replacing the battered files with stable versions, but I'm not sure it'd be caught since we're not technically throwing errors. Our onboard H5P editor works; it's just when columns (and anything running columns, like Interactive Books) are saved, the do not visually populate. It just blank screens. This is likely due to my edits that manipulate the type in a way that our system does not allow for. (See attached)

The only thing I can think to do and that I have the permissions for is to delete the Column 1.15 content type, and upload something like an Interactive Book that would hopefully reinstall it as a dependency. I do not have a clean content type install file as I don't have access to the hub. I can only download and upload local packages. Would this work?

I have attempted to upload one of the examples provided on this site to overwrite my overwrite, but unfortunately, it does not appear to be that simple. Our built H5P content still seem stable; I'm able to download and upload/view them on my Wordpress site, which makes me hopeful that this is just a corrupted content type that can be replaced.

Thank you for any help!

Content types: 
otacke's picture


Maybe we should set some things straight first so we are talking about the same things. H5P core files are what ships with the respective H5P integration. They cannot be overwritten by uploading content types.

H5P content files do not only contain the parameters entered and media files that the author may have used, but also all the libraries used to run the content. That makes it possible to share the content and to make sure other users can run it.

So, when someone uploads H5P content, H5P will compare the libraries on the server with the libraries inside the file. If there's a newer library within the file (based on the full version number, major version + minor version + patch version). If there is a newer version, then H5P will try to install that version, but only if the user has the required capabilities. That's not bound to the role per se, because the capabilities for a role can be changed.

So, answering your first question: Yes. When you upload H5P content files, you could overwrite existing H5P library files. If you upload files (with a higher library version and with the right capability) that you have tampered with, then your changes would end up on the server. If those changes expect a different parameter data structure for content than the original content that already had been created, content is likely to crash.

Without you sharing the output from the browser's development console or all of your changes, it's virtually impossible to tell what the problem may be.

If you understood what I explained above, you may have found the reason why uploading the latest version of Column in order to install it failed - it may not have a higher library version number. You should temporarily set the H5P plugin for moodle into development mode by temporarily adding

define( 'H5P_DEV' , true);

to moodle's config file, something that you don't have access to however, if I understand correctly. If you cannot run the procedure some other way, then you'd have to wait until the H5P core team releases an update to Column that would come with a higher version number. 

If you're using moodle's custom H5P integration, then I don't think it's possible to set a development mode. In that case, too, you may have to wait for an official update.

The alternative would be to identify the patched files via moodle's file API, replace them with the official ones, potentially fix the contents' parameters in the database (may be required now anyway) and take care of caching, but that's definitely something that you'd need more sophisticated access to the moodle instance for.



(I suffered a browser time out while posting my first reply, so apologizes if this is a duplicate response.)

Hi, Oliver;

Thank you so much for your response and explanation. For the most part, I do understand what you've described, and tragically, I have to admit that I don't think I have the privelieges to be able to take any of those steps. I am glad to relay some of this info in my support ticket, should I get a response.

I did a better inspection and have found, embarrassingly, that this all may be due to a simple syntax error:

values, or using “transform” along with “transform-origin: 0 0”. embed.php
Uncaught SyntaxError: missing ] after element list 0ad5b53e194f827ad7e1d4dc8614050e1cd0e4a6.js:640:4note: [ opened at line 620, column 190ad5b53e194f827ad7e1d4dc8614050e1cd0e4a6.js:620:19
Unable to find constructor for: H5P.Column 1.15 h5p.js:976:13
Uncaught TypeError: instance is undefined
jQuery 2
jQuery 4
Loading failed for the <script> with source “”. embed.php:1:1
Loading failed for the <script> with source “”. view.php:1:1


I can see the error, but it's located in a cache (attached screenshot) that I don't know if I can access. I've also attached an H5P file that I built locally, uploaded to Moodle, and downloaded from Moodle to see if there's any value in exploring a package from that content bank.

Would a cache clear be possible, and would it even fix the problem? I have since uploaded files created from in an attempt to update the library but they also are affected by this, so I'm not hopeful. I've also updated a file from my machine and sent it over with no luck. Perhaps you are right on the nose with a type update, and I'm worried that's not on the horizon any time soon.

Thank you again!

H5P file: 
otacke's picture


You can access the cache contents by simply clicking on the location (here `0ad...a6.js:620:19`). That's most likely a bug indeed that leads to a crash and thus no Column instance.

If the library has been properly installed, clearing the cache will not help. The library will need to be corrected, see my previous post. You can upload files from all day long - if they don't contain a later version of Column than on your moodle instance and moodle is not in development mode, then the Column library will not be installed (overwriting the faulty files).


Thank you, Oliver. Much appreciated.