function system_modules_uninstalled

Same name in other branches
  1. 8.9.x core/modules/system/system.module \system_modules_uninstalled()
  2. 10 core/modules/system/system.module \system_modules_uninstalled()
  3. 11.x core/modules/system/system.module \system_modules_uninstalled()

Implements hook_modules_uninstalled().

File

core/modules/system/system.module, line 1277

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);
        }
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.