Upgrade h5p content programmatically, Drupal 7

Is there a (simple) way to upgrade h5p content programmatically?

e.g. H5P.InteractiveVideo content from 1.9 to 1.11

Thanks

tomaj's picture

There is a button in the library overview where you can trigger upgrading a single content type.

Or did you mean upgrading programatically from your own code? There is no documented way of doing that. But there are known cases of people doing it by using the upgrade mechanisms in the JavaScript-files inside the h5p. It's intended for front-end use, but it might be possible to do it from a backend system.

There is currently no "one button" to push to upgrade all content types. But it might be a nice feature to have. And probably easy to implement.

Or did you mean upgrading programatically from your own code?

Exactly! I need to build upgrade path within my own code.

 

But there are known cases of people doing it by using the upgrade mechanisms in the JavaScript-files inside the h5p.

I've already spent some time on that, it looks pretty tricky, isn't it?
Is there any public samples, links to their code or something?

tomaj's picture

I don't know about any public samples. But if you get anything working, I'd be really interrested in how you solved it.

We decided not to do so for now, but thank you anyway

tomaj's picture

Ok, best of luck in your project anyway!