You are here

function system_modules_uninstalled in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/system/system.module \system_modules_uninstalled()
  2. 10 core/modules/system/system.module \system_modules_uninstalled()

Implements hook_modules_uninstalled().

File

core/modules/system/system.module, line 1262
Configuration system that lets administrators modify the workings of the site.

Code

function system_modules_uninstalled($modules) {

  // @todo Remove this when modules are able to maintain their revision metadata
  //   keys.
  //   @see https://www.drupal.org/project/drupal/issues/3074333
  if (!in_array('workspaces', $modules, TRUE)) {
    return;
  }
  $entity_definition_update_manager = \Drupal::entityDefinitionUpdateManager();
  foreach ($entity_definition_update_manager
    ->getEntityTypes() as $entity_type) {
    if ($entity_type instanceof ContentEntityTypeInterface && $entity_type
      ->hasRevisionMetadataKey('workspace')) {
      $entity_type
        ->setRevisionMetadataKey('workspace', NULL);
      $entity_definition_update_manager
        ->updateEntityType($entity_type);
    }
  }
}