Drupal: Upgrading Libraries and Backwards Compatibility with Existing Content
I posted the following comment in the Drupal module issue queue on drupal.org, but I thought I might also gain some traction here. Apologies for the double posting!
First, let me say I am blown away by H5P and what I have demo'ed to various stakeholders, they too have been so. Thank you for everyone's efforts in the Drupal module and the software at large!
Context: We are going to set up the Drupal module on an enterprise site, add the H5P field to a custom block type that we will place H5P content in the Layout Builder. We are going to use the Editor Hub to allow our content creators/managers to create the H5P content right in Drupal rather than create h5p file elsewhere and upload it.
What I am trying to better understand is the relationship between keeping libraries up-to-date, existing content, and backwards compatibility. I saw a note on this here: https://h5p.org/documentation/setup/drupal8 where it says:
"Updating old content to new versions can change their appearance and functionality significantly, preserving old content through library upgrades is always one of the main focuses of a library developer. Be aware of possible versioning and content upgrades issues when letting users upload altered H5P libraries."
Let's say I:
- Created an Image Hotspot piece of content in our block that uses the H5P field and is placed on a page in the Layout Builder. Then, the library has an update.
- I update the library in the admin menu at /admin/content/h5p.
- First Question: Does that new library now apply to all Image Hotspot pieces of content? Or, does the existing Image Hotspot content use the old libraries when it was first created?
- Second Question: Will we ever need to recreate or resave, in this example, all the Image Hotspot content to basically unbreak or update content when there is a new library update for a H5P content type? I realize this is a bit of general question, but any clarification would be helpful from people's experiences. I am trying to anticipate if there is a situation where we basically have to resave or rebuild every individual piece of H5P content when we do a library update.
Thank you so much for any clarifications or pointers to threads or other documentation I might have missed. I saw the thread for the Moodle plugin on this topic here: https://h5p.org/node/174487. It seemed to suggest that libraries generally wont break content and you won't have to resave or rebuild individual pieces of H5P content.
BV52
Fri, 04/01/2022 - 19:07
Permalink
Hi Jack,The new libraries
Hi Jack,
The new libraries only applies to contents created after updating them. Older contents will not use the new libraries not until you refresh the library cache in the list of libraries in Drupal or edit the old content. Once you edit the content it will atumatically use the newer libraries.
There is no need to recreate or resave.
-BV
jack.garratt
Fri, 04/01/2022 - 19:20
Permalink
Thank you for the insightful
Thank you for the insightful answer! That definitely answers my questions -- I appreciate the quick response, BV.
vaibhavbar
Thu, 02/08/2024 - 12:46
Permalink
Content Type not working
Hello,
When I am edit and create h5p questions the content type not loading, I checked in the content type response there is before the json space are coming, I checked in the code file there is all ok, I dont know why its getting space here, please help me in this. I attched screenshot please check
Thanks