- Home
- Schema Information For Module Media_library Was Missing From The Database.
Schema information for module media_library was missing from the database.
When doing the latest security updates to Drupal 9.5.5 one of our larger ecommerce sites threw up an error for the first time during a database update:
[error] The installed version of the /Media Library/ module is too old to update.
Update to a version prior to 9.0.0 first (missing updates:
media_library_post_update_display_modes,
media_library_post_update_table_display,
media_library_post_update_add_media_library_image_style,
media_library_post_update_add_status_extra_filter,
media_library_post_update_add_buttons_to_page_view,
media_library_post_update_update_8001_checkbox_classes,
media_library_post_update_default_administrative_list_to_table_display,
media_library_post_update_add_langcode_filters).
There is very little about this error returned by searching and what is there is quite old. The recommendation to roll-back core was not appealing so we did some digging around.
The site affected was built in D8 before the Media Library was available in core. Consequently the library was not used at all and we have no record of it being installed manually. However, it was installed at some point and finally lead to this issue.
The Fix
The fix is really simple in the case where the Media Library isn't being used, simply uninstall it either in /admin/modules or via drush. Clear the caches and you are good to go.
Bizarrely, if you reinstall it immediately the problem remains fixed.