Created
August 28, 2023 11:24
-
-
Save junaidpv/04fa42d786f24f6b17003b7f4b373947 to your computer and use it in GitHub Desktop.
This is a PHP script to run with drush on a drupal site that is giving error when updating from D9.4 to D9.5. The erros appearing like as reported at https://www.drupal.org/project/drupal/issues/3206215 and https://stackoverflow.com/questions/68598939/missing-updates-for-media-drupal-9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$post_update_registry = \Drupal::service('update.post_update_registry'); | |
$modules = [ | |
'block', | |
'block_content', | |
'comment', | |
'contextual', | |
'datetime_range', | |
'dblog', | |
'editor', | |
'field', | |
'image', | |
'layout_builder', | |
'layout_discovery', | |
'media', | |
'media_library', | |
'node', | |
'path', | |
'responsive_image', | |
'search', | |
'system', | |
'taxonomy', | |
'text', | |
'user', | |
'menu_link_content', | |
'views' | |
]; | |
foreach ($modules as $module) { | |
$removed_post_updates = $post_update_registry->getRemovedPostUpdates('block'); | |
$post_update_registry->registerInvokedUpdates(array_keys($removed_post_updates)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment